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
이 커밋은 다음에 포함됨:
Fabian Ritter 작성하고 Konstantin Zhuravlyov가 2024-06-04 09:32:52 -04:00를 커밋함
1 부모 fa4c1a0206
커밋 819e537dc5
1 파일이 변경됨
+1
+1
파일 보기
@@ -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