mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-26 09:14:00 +00:00
Openmp parallel iterator improvements (#9493)
* More flexibility in OpenMP pragma * Use static to constrain to compile-time annotation string * Update changelog with OpenMP change
This commit is contained in:
committed by
Andreas Rumpf
parent
c844a9169c
commit
5b97762787
@@ -2186,10 +2186,14 @@ else:
|
||||
inc(res)
|
||||
|
||||
|
||||
iterator `||`*[S, T](a: S, b: T, annotation=""): T {.
|
||||
iterator `||`*[S, T](a: S, b: T, annotation: static string = "parallel for"): T {.
|
||||
inline, magic: "OmpParFor", sideEffect.} =
|
||||
## parallel loop iterator. Same as `..` but the loop may run in parallel.
|
||||
## OpenMP parallel loop iterator. Same as `..` but the loop may run in parallel.
|
||||
## `annotation` is an additional annotation for the code generator to use.
|
||||
## The default annotation is `parallel for`.
|
||||
## Please refer to the `OpenMP Syntax Reference<https://www.openmp.org/wp-content/uploads/OpenMP-4.5-1115-CPP-web.pdf>`_
|
||||
## for further information.
|
||||
##
|
||||
## Note that the compiler maps that to
|
||||
## the ``#pragma omp parallel for`` construct of `OpenMP`:idx: and as
|
||||
## such isn't aware of the parallelism in your code! Be careful! Later
|
||||
|
||||
Reference in New Issue
Block a user