Add __device__ specifier to HIP's warpSize constexpr variable

The warpSize variable is set to the value of the __AMDGCN_WAVEFRONT_SIZE macro,
which is a meaningless default in host code.
The resolution for SWDEV-449015 will introduce diagnostics for uses of this
macro in host code, which includes the current definition of the warpSize
variable. With the __device__ specifier, the definition of the warpSize
variable will not cause these diagnostics.

This change does not stop the variable from being used in host code since clang
intentionally does not diagnose uses of __device__ constexpr variables in host
code.

Change-Id: I0317217affe94fdf2dfd9ad0f134e68f5173245f


[ROCm/clr commit: 819e537dc5]
This commit is contained in:
Fabian Ritter
2024-05-10 07:32:03 -04:00
committed by Konstantin Zhuravlyov
parent 6f2179d9d8
commit 10b3a313d2
@@ -73,6 +73,7 @@ __device__ static inline int __hip_move_dpp_N(int src) {
bound_ctrl);
}
__device__
static constexpr int warpSize = __AMDGCN_WAVEFRONT_SIZE;
// warp vote function __all __any __ballot