[libomptarget][nvptx] Bug fix: Correctly identify the warp master active thread.
git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@327556 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu b/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
index e2a38e3..cd73a6b 100644
--- a/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
+++ b/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
@@ -37,7 +37,8 @@
unsigned long long Mask = getActiveThreadsMask();
unsigned long long ShNum = WARPSIZE - (getThreadId() % WARPSIZE);
unsigned long long Sh = Mask << ShNum;
- return Sh == 0;
+ // Truncate Sh to the 32 lower bits
+ return (unsigned)Sh == 0;
}
// Return true if this is the master thread.
__device__ static bool IsMasterThread() {