summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-05-23 02:05:28 +0200
committerAraq <rumpf_a@web.de>2012-05-23 02:05:28 +0200
commit848c1b297f8f45fd3b69c3886e8328b738def0be (patch)
tree92553c0ea79e239cbb57d7b663a0bb75b0a6c6eb /lib
parent1c01c78be539d31eaec424dcd3498f11103f06a5 (diff)
downloadNim-848c1b297f8f45fd3b69c3886e8328b738def0be.tar.gz
added system.||; lacks runtime support
Diffstat (limited to 'lib')
-rwxr-xr-xlib/core/macros.nim2
-rwxr-xr-xlib/system.nim9
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 8b08952f0..21f5134e2 100755
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -36,7 +36,7 @@ type
     nnkMacroDef, nnkTemplateDef, nnkIteratorDef, nnkOfBranch, 

     nnkElifBranch, nnkExceptBranch, nnkElse, nnkMacroStmt, 

     nnkAsmStmt, nnkPragma, nnkPragmaBlock, nnkIfStmt, nnkWhenStmt, 

-    nnkForStmt, nnkWhileStmt, nnkCaseStmt, 

+    nnkForStmt, nnkParForStmt, nnkWhileStmt, nnkCaseStmt, 

     nnkTypeSection, nnkVarSection, nnkLetSection, nnkConstSection, 

     nnkConstDef, nnkTypeDef, 

     nnkYieldStmt, nnkTryStmt, nnkFinally, nnkRaiseStmt, 

diff --git a/lib/system.nim b/lib/system.nim
index f78ca9738..148df7e34 100755
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1200,6 +1200,15 @@ iterator `..`*[S, T](a: S, b: T): T {.inline.} =
     yield res
     inc res
 
+iterator `||`*[S, T](a: S, b: T, annotation=""): T {.
+  inline, magic: "OmpParFor", sideEffect.} =
+  ## parallel loop iterator. Same as `..` but the loop may run in parallel.
+  ## `annotation` is an additional annotation for the code generator to use.
+  ## 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.
+  nil
+
 proc min*(x, y: int): int {.magic: "MinI", noSideEffect.}
 proc min*(x, y: int8): int8 {.magic: "MinI", noSideEffect.}
 proc min*(x, y: int16): int16 {.magic: "MinI", noSideEffect.}
180' href='#n180'>180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195