summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorMamy Ratsimbazafy <mratsim@users.noreply.github.com>2018-10-25 18:09:35 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-25 18:09:35 +0200
commit5b977627870d925e79dca1dd5cee615015314b5d (patch)
tree32fbf5d09c2568b389cab979c684049239532aac /lib/system.nim
parentc844a9169ccb445cc16584db4f434074614b357e (diff)
downloadNim-5b977627870d925e79dca1dd5cee615015314b5d.tar.gz
Openmp parallel iterator improvements (#9493)
* More flexibility in OpenMP pragma
* Use static to constrain to compile-time annotation string
* Update changelog with OpenMP change
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 05ffa63b4..f852a0aed 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -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