[Openmp-commits] [PATCH] D55773: [OpenMP][libomptarget] Use shared memory variable for tracking parallel level

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 9 09:01:26 PST 2019


ABataev added inline comments.


================
Comment at: libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu:98
     setExecutionParameters(Spmd, RuntimeUninitialized);
-    if (GetThreadIdInBlock() == 0) {
-      int slot = smid() % MAX_SM;
-      usedSlotIdx = slot;
-      omptarget_nvptx_simpleThreadPrivateContext =
-          omptarget_nvptx_device_simpleState[slot].Dequeue();
-    }
-    // FIXME: use __syncthreads instead when the function copy is fixed in LLVM.
+    parallelLevel = 0;
+    if (threadId == 0)
----------------
Better to put this initialization under the guard of the next `if` statement.


Repository:
  rOMP OpenMP

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55773/new/

https://reviews.llvm.org/D55773





More information about the Openmp-commits mailing list