From 4e53b0d04ff3087ce7cb171bc63d1825c6bede25 Mon Sep 17 00:00:00 2001 From: Jakub Chlanda Date: Thu, 30 Sep 2021 10:18:21 +0000 Subject: [PATCH] Correctly set the index value for __shf_up. --- include/hip/hcc_detail/device_functions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hip/hcc_detail/device_functions.h b/include/hip/hcc_detail/device_functions.h index 515b4cc6a4..c751fb3cf4 100644 --- a/include/hip/hcc_detail/device_functions.h +++ b/include/hip/hcc_detail/device_functions.h @@ -427,7 +427,7 @@ inline int __shfl_up(int var, unsigned int lane_delta, int width = warpSize) { int self = __lane_id(); int index = self - lane_delta; - index = (index < (self & ~(width-1)))?self:index; + index = (index < (self & ~(width-1)))?index:self; return __builtin_amdgcn_ds_bpermute(index<<2, var); } __device__