[CLR] prevent compilation errors for non-HIP compilers in amd_hip_mx_common.h and amd_hip_ocp_types.h (#2448)

Co-authored-by: Andrei Kochin <andrei.kochin@amd.com>
This commit is contained in:
Alexandra Sidorova
2026-01-08 17:49:13 +04:00
committed by GitHub
vanhempi 6b28faa532
commit 38a359f5f3
2 muutettua tiedostoa jossa 8 lisäystä ja 2 poistoa
@@ -43,6 +43,8 @@ enum hipRoundMode {
hipRoundMinInf = 3,
};
#if defined(__clang__) && defined(__HIP__)
namespace internal {
__host__ __device__ static inline __amd_fp16_storage_t half_to_f16(const __half val) {
__half_raw tmp = val;
@@ -71,4 +73,7 @@ __host__ __device__ static inline __amd_bf16x2_storage_t hipbf162_to_bf16x2(cons
} u{val};
return u.bf16;
}
} // namespace internal
#endif // defined(__clang__) && defined(__HIP__)
@@ -83,8 +83,9 @@ typedef _Float16 __attribute__((vector_size(16))) __amd_fp16x8_storage_t;
typedef _Float16 __attribute__((vector_size(64))) __amd_fp16x32_storage_t;
typedef uint32_t __attribute__((vector_size(24))) __amd_fp6x32_storage_t;
typedef short __attribute__((vector_size(4))) __amd_shortx2_storage_t;
#else
#error "Only supported by HIPCC or GCC >= 13."
#endif
#if (defined(__clang__) && (__clang_major__ > 17) && defined(__HIP__)) || \
(defined(__GNUC__) && (__GNUC__ > 13))
static_assert(sizeof(__amd_uintx2_storage_t) == sizeof(__amd_fp8x8_storage_t));
#endif