From 6881c754e1ce4b154ad48e8532d4680e3a54096c Mon Sep 17 00:00:00 2001 From: pmaybank <113125070+pmaybank@users.noreply.github.com> Date: Fri, 8 May 2026 18:44:37 -0400 Subject: [PATCH] use HIP_VERSION variables to guard against duplicate atomicAdd definitions (#41802) Signed-off-by: Philip Maybank Co-authored-by: TJian --- csrc/quantization/gptq/compat.cuh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csrc/quantization/gptq/compat.cuh b/csrc/quantization/gptq/compat.cuh index 1b3fb3d391..f95f3fd958 100644 --- a/csrc/quantization/gptq/compat.cuh +++ b/csrc/quantization/gptq/compat.cuh @@ -42,8 +42,8 @@ __device__ __forceinline__ void atomicAdd_half2(half2* address, half2 val) { } // - -#if defined(__CUDA_ARCH__) || defined(USE_ROCM) +#if defined(__CUDA_ARCH__) || \ + (defined(USE_ROCM) && (HIP_VERSION_MAJOR * 100 + HIP_VERSION_MINOR) < 713) #if __CUDA_ARCH__ < 700 || defined(USE_ROCM) __device__ __forceinline__ void atomicAdd(half* address, half val) {