-
Notifications
You must be signed in to change notification settings - Fork 7
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
Refactor #84
Conversation
There was a problem hiding this 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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем удалять акие комментарии?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Они перенесены в публичный api.
There was a problem hiding this comment.
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 = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему мы не хотим базовые функции сделать доступными широкой общественности?
There was a problem hiding this comment.
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 = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему map остался, а map2 переехал?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, нет причин не переносить. Сейчас перенесу.
А чего таки не собралось? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Зачем прятать то, что может быть потенциально полезно? Я понимаю, зачем прятать функции, самостоятельный вызов которых может "всё сломать". Но безопасные зачем прятать?
- Комментарии. Не надо комментариев ради комментариев. И удалять комментарии, которые несут ценную информацию, тоже не надо
- Такое ощущение, что некоторые подпространства имён не такие и лишние. Типа сортрировок, которых много разных, 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), |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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 = |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А у нас же когда-то было две разных сортировки.
Proposed Changes
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 applyChecklist
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.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...