Skip to content

Commit 59be4b4

Browse files
author
George Rokos
committed
[libomptarget][nvptx] Bug fix: Correctly identify the warp master active thread.
llvm-svn: 327556
1 parent 4e6b822 commit 59be4b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ __device__ static bool IsWarpMasterActiveThread() {
3737
unsigned long long Mask = getActiveThreadsMask();
3838
unsigned long long ShNum = WARPSIZE - (getThreadId() % WARPSIZE);
3939
unsigned long long Sh = Mask << ShNum;
40-
return Sh == 0;
40+
// Truncate Sh to the 32 lower bits
41+
return (unsigned)Sh == 0;
4142
}
4243
// Return true if this is the master thread.
4344
__device__ static bool IsMasterThread() {

0 commit comments

Comments
 (0)