Index: clang/lib/Basic/Targets/AMDGPU.cpp =================================================================== --- clang/lib/Basic/Targets/AMDGPU.cpp +++ clang/lib/Basic/Targets/AMDGPU.cpp @@ -315,6 +315,8 @@ if (hasFastFMA()) Builder.defineMacro("FP_FAST_FMA"); + Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE__", Twine(WavefrontSize)); + // ToDo: deprecate this macro for naming consistency. Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE", Twine(WavefrontSize)); Builder.defineMacro("__AMDGCN_CUMODE__", Twine(CUMode)); } Index: clang/test/CodeGenHIP/maybe_undef-attr-verify.hip =================================================================== --- clang/test/CodeGenHIP/maybe_undef-attr-verify.hip +++ clang/test/CodeGenHIP/maybe_undef-attr-verify.hip @@ -20,7 +20,7 @@ #define __maybe_undef __attribute__((maybe_undef)) #define WARP_SIZE 64 -static constexpr int warpSize = __AMDGCN_WAVEFRONT_SIZE; +static constexpr int warpSize = __AMDGCN_WAVEFRONT_SIZE__; __device__ static inline unsigned int __lane_id() { return __builtin_amdgcn_mbcnt_hi( Index: clang/test/Driver/hip-macros.hip =================================================================== --- clang/test/Driver/hip-macros.hip +++ clang/test/Driver/hip-macros.hip @@ -17,8 +17,8 @@ // RUN: %clang -E -dM --offload-arch=gfx1010 -mno-wavefrontsize64 \ // RUN: --cuda-device-only -nogpuinc -nogpulib \ // RUN: -mwavefrontsize64 %s 2>&1 | FileCheck --check-prefixes=WAVE64 %s -// WAVE64-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64 -// WAVE32-DAG: #define __AMDGCN_WAVEFRONT_SIZE 32 +// WAVE64-DAG: #define __AMDGCN_WAVEFRONT_SIZE__ 64 +// WAVE32-DAG: #define __AMDGCN_WAVEFRONT_SIZE__ 32 // RUN: %clang -E -dM --offload-arch=gfx906 --cuda-device-only -nogpuinc -nogpulib \ // RUN: %s 2>&1 | FileCheck --check-prefix=CUMODE-ON %s