[Openmp-commits] [openmp] r342972 - [OpenMP][libomptarget] Simplify warp master selection for data sharing

Gheorghe-Teodor Bercea via Openmp-commits openmp-commits at lists.llvm.org
Tue Sep 25 06:23:32 PDT 2018


Author: gbercea
Date: Tue Sep 25 06:23:32 2018
New Revision: 342972

URL: http://llvm.org/viewvc/llvm-project?rev=342972&view=rev
Log:
[OpenMP][libomptarget] Simplify warp master selection for data sharing

Summary:
There is currently no supported situation where the warp master is not the first thread in the warp.

This also avoids the device execution from hanging on Volta GPUs when ballot_sync is called by a number of threads that is less that the size of a warp.


Reviewers: ABataev, caomhin, grokos

Reviewed By: grokos

Subscribers: guansong, openmp-commits

Differential Revision: https://reviews.llvm.org/D50188

Modified:
    openmp/trunk/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu

Modified: openmp/trunk/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu?rev=342972&r1=342971&r2=342972&view=diff
==============================================================================
--- openmp/trunk/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu (original)
+++ openmp/trunk/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu Tue Sep 25 06:23:32 2018
@@ -389,7 +389,7 @@ EXTERN void* __kmpc_data_sharing_push_st
   void *&FrameP = DataSharingState.FramePtr[WID];
 
   // Only warp active master threads manage the stack.
-  if (IsWarpMasterActiveThread()) {
+  if (getThreadId() % WARPSIZE == 0) {
     // SlotP will point to either the shared memory slot or an existing
     // global memory slot.
     __kmpc_data_sharing_slot *&SlotP = DataSharingState.SlotPtr[WID];
@@ -468,7 +468,7 @@ EXTERN void __kmpc_data_sharing_pop_stac
     return omptarget_nvptx_SimpleThreadPrivateContext::Deallocate(FrameStart);
   }
 
-  if (IsWarpMasterActiveThread()) {
+  if (getThreadId() % WARPSIZE == 0) {
     unsigned WID = getWarpId();
 
     // Current slot




More information about the Openmp-commits mailing list