diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu index e2a38e35e0b1..cd73a6b4108f 100644 --- a/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu @@ -37,7 +37,8 @@ __device__ static bool IsWarpMasterActiveThread() { 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() {