From 0a47b8cbc59682f1eb414ca923daebbd9244c385 Mon Sep 17 00:00:00 2001 From: Jakub Chlanda Date: Wed, 6 Oct 2021 11:48:15 +0100 Subject: [PATCH] Correctly set the index value for __shf_up. --- include/hip/amd_detail/amd_device_functions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hip/amd_detail/amd_device_functions.h b/include/hip/amd_detail/amd_device_functions.h index f9b9570d..46f2eb80 100644 --- a/include/hip/amd_detail/amd_device_functions.h +++ b/include/hip/amd_detail/amd_device_functions.h @@ -425,7 +425,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__