SWDEV-542832 - Refactor vector types alignment (#713)
[ROCm/clr commit: 918b0bdb7a]
This commit is contained in:
committed by
GitHub
parent
e5226f2b7e
commit
b6d69d162e
@@ -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, n>)))
|
||||
T __attribute__((ext_vector_type(n))) __attribute__((aligned(__hip_vec_align_v<T, n>())))
|
||||
#else
|
||||
#define __NATIVE_VECTOR__(n, T) alignas(__hip_vec_align_v<T, n>) T[n]
|
||||
#define __NATIVE_VECTOR__(n, T) alignas(__hip_vec_align_v<T, n>()) T[n]
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
@@ -52,9 +52,9 @@ THE SOFTWARE.
|
||||
#include <type_traits>
|
||||
#endif // defined(__HIPCC_RTC__)
|
||||
|
||||
template <class T, int N>
|
||||
inline constexpr __hip_internal::size_t __hip_vec_align_v =
|
||||
((N == 4 && alignof(T) == 8) ? 16 : N * alignof(T));
|
||||
template <class T, int N> constexpr __hip_internal::size_t __hip_vec_align_v() {
|
||||
return (N == 4 && alignof(T) == 8) ? 16 : N * alignof(T);
|
||||
}
|
||||
|
||||
template <typename T, unsigned int n> struct HIP_vector_base;
|
||||
template <typename T, unsigned int rank> struct HIP_vector_type;
|
||||
|
||||
Reference in New Issue
Block a user