[Openmp-commits] [PATCH] D50188: [OpenMP] Simplify warp master selection for data sharing
Gheorghe-Teodor Bercea via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Aug 2 07:57:46 PDT 2018
gtbercea created this revision.
gtbercea added reviewers: ABataev, caomhin.
Herald added subscribers: openmp-commits, guansong.
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.
Repository:
rOMP OpenMP
https://reviews.llvm.org/D50188
Files:
libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
Index: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
===================================================================
--- libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
+++ libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
@@ -380,7 +380,7 @@
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];
@@ -453,7 +453,7 @@
// reclaim all outstanding global memory slots since it is
// likely we have reached the end of the kernel.
EXTERN void __kmpc_data_sharing_pop_stack(void *FrameStart) {
- if (IsWarpMasterActiveThread()) {
+ if (getThreadId() % WARPSIZE == 0) {
unsigned WID = getWarpId();
// Current slot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50188.158755.patch
Type: text/x-patch
Size: 937 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180802/c68c9300/attachment.bin>
More information about the Openmp-commits
mailing list