[Openmp-commits] [PATCH] D53141: [OpenMP][libomptarget] Add runtime function for pushing coalesced global records

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Oct 24 06:25:21 PDT 2018

ABataev added inline comments.

Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:389
   unsigned WID = getWarpId();
+  // void * volatile FramePointer = 0;
   void *&FrameP = DataSharingState.FramePtr[WID];
This must be removed

Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:438
+        // point to the start of the new frame held in StackP.
+        //atomicExch((unsigned long long *)&FrameP, (unsigned long long)StackP);
+        FrameP = StackP;
Also, must be removed

Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:444
+    }
+  } while (!FrameP);
It is a very bad idea to have something like this without atomic instructions.
Also, for writing, you need to use atomic instructions (+, possibly, `volatile` data type). Otherwise, it leads to undefined behavior and problems during optimization.

  rOMP OpenMP


More information about the Openmp-commits mailing list