-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add parallel scan #5
Conversation
lib/task.ml
Outdated
~body:(fun i -> | ||
let s = (i * n) / (p ) in | ||
let e = (i + 1) * n / (p ) - 1 in | ||
(* Printf.printf "s = %d e = %d\n" s e; *) |
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.
Remove comments.
lib/task.mli
Outdated
|
||
val parallel_scan : pool -> ('a -> 'a -> 'a) -> 'a array -> 'a array | ||
(** [parallel_scan p op a] computes the scan of the array a | ||
* in parallel with binary operator op and returns the result array. |
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.
* in parallel with binary operator op and returns the result array. | |
* in parallel with binary operator [op] and returns the result array. |
lib/task.mli
Outdated
@@ -39,3 +39,9 @@ val parallel_for_reduce : pool -> ('a -> 'a -> 'a) -> 'a -> chunk_size:int -> | |||
(** [parallel_for_reduce p r i c s f b] is similar to [parallel_for] except | |||
* that the result returned by each iteration is reduced with [r] with initial | |||
* value [i]. *) | |||
|
|||
val parallel_scan : pool -> ('a -> 'a -> 'a) -> 'a array -> 'a array | |||
(** [parallel_scan p op a] computes the scan of the array a |
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.
(** [parallel_scan p op a] computes the scan of the array a | |
(** [parallel_scan p op a] computes the scan of the array [a] |
lib/task.mli
Outdated
val parallel_scan : pool -> ('a -> 'a -> 'a) -> 'a array -> 'a array | ||
(** [parallel_scan p op a] computes the scan of the array a | ||
* in parallel with binary operator op and returns the result array. | ||
* Scan is similar to Array.fold_left but returns an array of reduced |
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.
* Scan is similar to Array.fold_left but returns an array of reduced | |
* Scan is similar to [Array.fold_left] but returns an array of reduced |
Can you comment on how this scales @Sudha247? |
These are some numbers for the
|
Thanks. I'll merge this one. We should revisit the performance. I would be curious to know where the overheads lie. |
No description provided.