Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq committed Apr 26, 2024
1 parent 3924137 commit 95eff66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/malebolgia/paralgos.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ template `@!`[T](data: openArray[T]; i: int): untyped =
cast[ptr UncheckedArray[T]](addr data[i])

template parApply*[T](data: var openArray[T]; bulkSize: int; op: untyped) =
##[ Applies `op` on every element of `data`, `op(data[i)` in parallel.
##[ Applies `op` on every element of `data`, `op(data[i])` in parallel.
`bulkSize` specifies how many elements are processed sequentially
and not in parallel because sending a task to a different thread
is expensive. `bulkSize` should probably be larger than you think but
Expand All @@ -23,8 +23,8 @@ template parApply*[T](data: var openArray[T]; bulkSize: int; op: untyped) =
if i < data.len:
m.spawn worker(data@!i, data.len-i)

template parMap*[T](data: var openArray[T]; bulkSize: int; op: untyped): untyped =
##[ Applies `op` on every element of `data`, `op(data[i)` in parallel.
template parMap*[T](data: openArray[T]; bulkSize: int; op: untyped): untyped =
##[ Applies `op` on every element of `data`, `op(data[i])` in parallel.
Produces a new `seq` of `typeof(op(data[i]))`.
`bulkSize` specifies how many elements are processed sequentially
and not in parallel because sending a task to a different thread
Expand Down

0 comments on commit 95eff66

Please sign in to comment.