diff options
author | Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> | 2018-09-25 13:23:32 +0000 |
---|---|---|
committer | Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> | 2018-09-25 13:23:32 +0000 |
commit | a90f0c458dc4c7591dae51882a62109871816162 (patch) | |
tree | 845efb4e7372ae9745541b97e0a3cfc700f82efa /openmp/libomptarget | |
parent | 469d47a5972c31a304cffc291fb1d4967c9a48d3 (diff) |
[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
Diffstat (limited to 'openmp/libomptarget')
-rw-r--r-- | openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu index 2b3a90f6e64..6e1548b703d 100644 --- a/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu @@ -389,7 +389,7 @@ EXTERN void* __kmpc_data_sharing_push_stack(size_t DataSize, 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_stack(void *FrameStart) { return omptarget_nvptx_SimpleThreadPrivateContext::Deallocate(FrameStart); } - if (IsWarpMasterActiveThread()) { + if (getThreadId() % WARPSIZE == 0) { unsigned WID = getWarpId(); // Current slot |