From 918b0bdb7aa3faf4962fbf6d82de6e499fe8b33b Mon Sep 17 00:00:00 2001 From: "Dittakavi, Satyanvesh" Date: Tue, 15 Jul 2025 21:09:31 +0530 Subject: [PATCH] SWDEV-542832 - Refactor vector types alignment (#713) --- hipamd/include/hip/amd_detail/amd_hip_vector_types.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hipamd/include/hip/amd_detail/amd_hip_vector_types.h b/hipamd/include/hip/amd_detail/amd_hip_vector_types.h index 1443d69f66..ee950c3e2f 100644 --- a/hipamd/include/hip/amd_detail/amd_hip_vector_types.h +++ b/hipamd/include/hip/amd_detail/amd_hip_vector_types.h @@ -40,9 +40,9 @@ THE SOFTWARE. #if __has_attribute(ext_vector_type) #define __HIP_USE_NATIVE_VECTOR__ 1 #define __NATIVE_VECTOR__(n, T) \ - T __attribute__((ext_vector_type(n))) __attribute__((aligned(__hip_vec_align_v))) + T __attribute__((ext_vector_type(n))) __attribute__((aligned(__hip_vec_align_v()))) #else -#define __NATIVE_VECTOR__(n, T) alignas(__hip_vec_align_v) T[n] +#define __NATIVE_VECTOR__(n, T) alignas(__hip_vec_align_v()) T[n] #endif #if defined(__cplusplus) @@ -52,9 +52,9 @@ THE SOFTWARE. #include #endif // defined(__HIPCC_RTC__) -template -inline constexpr __hip_internal::size_t __hip_vec_align_v = - ((N == 4 && alignof(T) == 8) ? 16 : N * alignof(T)); +template constexpr __hip_internal::size_t __hip_vec_align_v() { + return (N == 4 && alignof(T) == 8) ? 16 : N * alignof(T); +} template struct HIP_vector_base; template struct HIP_vector_type;