[Openmp-commits] [PATCH] D49204: [OpenMP][libomptarget] Fix data sharing and globalization infrastructure to work in SPMD mode

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 12 09:17:37 PDT 2018

grokos added inline comments.

Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:416
+        NewSize = DefaultSlotSize;
+      NewSlot = (__kmpc_data_sharing_slot *) malloc(
+          sizeof(__kmpc_data_sharing_slot) + NewSize);
Better use `SafeMalloc`.

Comment at: libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h:295-296
+  INLINE __kmpc_data_sharing_slot *GetPreallocatedSlotAddr(int wid) {
+    // If this is invoked by the master thread of the master warp then intialize
+    // it with a smaller slot.
+    worker_rootS[wid].DataEnd =
Leftover comment from the previous implementation? In `data_sharing.cu` we said that for uniformity the master thread uses slots of the same size as the workers.

Comment at: libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h:316
+      __kmpc_data_sharing_worker_slot_static worker_rootS[WARPSIZE];
   __align__(16) __kmpc_data_sharing_master_slot_static master_rootS[1];
Is `master_rootS` still needed? From what I understand, all threads (master and workers) now use the same slot type, that's why `worker_rootS` was increased in size from `WARPSIZE-1` to `WARPSIZE`.

  rOMP OpenMP


More information about the Openmp-commits mailing list