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

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 12 09:08:59 PDT 2018


ABataev added inline comments.


================
Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:47
 __device__ static bool IsMasterThread() {
-  return getMasterThreadId() == getThreadId();
+  return getMasterThreadId() == getThreadId() && !isSPMDMode();
 }
----------------
Better to check `!isSPMDMode()` at first


================
Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:337
+
+  for(int WID=0; WID<WARPSIZE; WID++) {
+    __kmpc_data_sharing_slot *RootS = teamDescr->GetPreallocatedSlotAddr(WID);
----------------
Seems to me the code is not clang-formatted


================
Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:466
+    // pop.
+    bool SlotEmpty = ((uintptr_t)StackP == (uintptr_t)&SlotP->Data[0]);
+
----------------
You can just compare pointers as is, no need to cast


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D49204





More information about the Openmp-commits mailing list