Skip to content

Refactor #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Oct 2, 2023
Merged

Refactor #84

merged 22 commits into from
Oct 2, 2023

Conversation

artemiipatov
Copy link
Contributor

Proposed Changes

  • API
  • Comments
  • namespace/module names change

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce to GraphBLAS-sharp?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • Build and tests pass locally
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Copy link
Member

@gsvgit gsvgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Круто. Но есть ряд вопросов. В целом, не уверен, что есть смысл специально прятать функции, особенно если они безопасны.

@@ -208,24 +208,6 @@ module PrefixSum =

let runBackwardsIncludeInPlace plus = runInPlace plus true scanInclusive

/// <summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем удалять акие комментарии?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Они перенесены в публичный api.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Так а удалть зачем? Внутренняя документация тоже нужна.


module Radix =
module internal Radix =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему мы не хотим базовые функции сделать доступными широкой общественности?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Из публичного api к ним можно получить доступ. Доступ к модулю с реализацией решил ограничить.

/// </remarks>
/// <param name="clContext">OpenCL context.</param>
/// <param name="workGroupSize">Should be a power of 2 and greater than 1.</param>
let map2 (op: Expr<'a option -> 'b option -> 'c option>) (clContext: ClContext) workGroupSize =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему map остался, а map2 переехал?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, нет причин не переносить. Сейчас перенесу.

@gsvgit
Copy link
Member

gsvgit commented Jul 27, 2023

А чего таки не собралось?

Copy link
Member

@gsvgit gsvgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Зачем прятать то, что может быть потенциально полезно? Я понимаю, зачем прятать функции, самостоятельный вызов которых может "всё сломать". Но безопасные зачем прятать?
  2. Комментарии. Не надо комментариев ради комментариев. И удалять комментарии, которые несут ценную информацию, тоже не надо
  3. Такое ощущение, что некоторые подпространства имён не такие и лишние. Типа сортрировок, которых много разных, BFS, может ещё чего.

@@ -125,10 +127,11 @@ type WithoutTransferBenchmark<'elem when 'elem : struct>(
type BFSWithoutTransferBenchmarkInt32() =

inherit WithoutTransferBenchmark<int>(
(singleSource ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
(Algorithms.singleSourceBFS ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вообще, bfs-ов может быть много разных. Так что может и стоит сделать подпространство Algorithms.BFS.

/// ...
/// > val result = [| 3.6; 1.4; 3.6; 2.5 |]
/// </code>
/// </example>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Верните, пожалуйста, эти комментарии. Иначе как изучать саму реализацию?


module Reduce =
module internal Reduce =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Но зачем? Почему люди не могут пользоваться этим снаружи?


module Matrix =
let map = Map.run

let map2 = Map2.run

///<param name="clContext">.</param>
///<param name="opAdd">.</param>
///<param name="workGroupSize">Should be a power of 2 and greater than 1.</param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну вот это же было полезное знание.

[<RequireQualifiedAccess>]
type ClMatrix<'a when 'a: struct> =
| CSR of ClMatrix.CSR<'a>
| COO of ClMatrix.COO<'a>
| CSC of ClMatrix.CSC<'a>
| LIL of ClMatrix.LIL<'a>

/// <summary>
/// Row count.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Содержательно)

@@ -430,7 +430,7 @@ module internal Kronecker =
let mapAll = mapAll clContext workGroupSize op

let bitonic =
Sort.Bitonic.sortKeyValuesInplace clContext workGroupSize
Common.Bitonic.sortKeyValuesInplace clContext workGroupSize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А у нас же когда-то было две разных сортировки.

@artemiipatov artemiipatov requested a review from gsvgit September 30, 2023 16:51
@gsvgit gsvgit merged commit 8a79b41 into SparseLinearAlgebra:master Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants