[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

llvm-svn: 342972
This commit is contained in:
Gheorghe-Teodor Bercea 2018-09-25 13:23:32 +00:00
parent eece4058a4
commit 9bc3bfffb4
1 changed files with 2 additions and 2 deletions

View File

@ -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