Skip to content

Commit 7b17897

Browse files
committed
[ROCm] do not use __shfl sync functions
This avoids a static_assert compile-time failure for HIP.
1 parent 38289bf commit 7b17897

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

csrc/cuda/utils.cuh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
AT_ASSERTM(x.device().is_cuda(), #x " must be CUDA tensor")
77
#define CHECK_INPUT(x) AT_ASSERTM(x, "Input mismatch")
88

9+
#ifndef USE_ROCM
910
__device__ __inline__ at::Half __shfl_up_sync(const unsigned mask,
1011
const at::Half var,
1112
const unsigned int delta) {
@@ -17,6 +18,7 @@ __device__ __inline__ at::Half __shfl_down_sync(const unsigned mask,
1718
const unsigned int delta) {
1819
return __shfl_down_sync(mask, var.operator __half(), delta);
1920
}
21+
#endif
2022

2123
__device__ __inline__ at::Half __shfl_up(const at::Half var,
2224
const unsigned int delta) {

0 commit comments

Comments
 (0)