From 62cdbd57f2ecc17e2074a6138097e344fbd156f2 Mon Sep 17 00:00:00 2001 From: Tony Davis Date: Wed, 6 May 2026 16:06:33 +0000 Subject: [PATCH] hipblaslt: restore *_EXT hipDataType names as compatibility macros (ROCM-24233) PR #6499 dropped int const HIP_R_*_EXT for mxfp4 types now represented in HIP's hipDataType enum. Re-introduce those spellings as preprocessor aliases to HIP_R_6F_E2M3 / HIP_R_6F_E3M2 / HIP_R_4F_E2M1 when building for AMD HIP, with numeric fallbacks elsewhere, matching prior constant values. Fixes JAX/XLA builds that still reference HIP_R_4F_E2M1_EXT, without duplicating symbols or conflicting with HIP_R_8F_E5M3_EXT. Co-authored-by: Cursor --- .../include/hipblaslt/hipblaslt-types.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/projects/hipblaslt/library/include/hipblaslt/hipblaslt-types.h b/projects/hipblaslt/library/include/hipblaslt/hipblaslt-types.h index d17651bcf6e..e3d266cd8f2 100644 --- a/projects/hipblaslt/library/include/hipblaslt/hipblaslt-types.h +++ b/projects/hipblaslt/library/include/hipblaslt/hipblaslt-types.h @@ -75,5 +75,33 @@ typedef int32_t hipblasLtInt32; } #endif +/* + * Legacy *_EXT names were int constants mirroring hipDataType values. HIP now + * exposes HIP_R_6F_E2M3 / HIP_R_6F_E3M2 / HIP_R_4F_E2M1 in library_types.h. + * Provide macro aliases so existing consumers keep building (ROCM-24233). + */ +#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__) +#include +#ifndef HIP_R_6F_E2M3_EXT +#define HIP_R_6F_E2M3_EXT HIP_R_6F_E2M3 +#endif +#ifndef HIP_R_6F_E3M2_EXT +#define HIP_R_6F_E3M2_EXT HIP_R_6F_E3M2 +#endif +#ifndef HIP_R_4F_E2M1_EXT +#define HIP_R_4F_E2M1_EXT HIP_R_4F_E2M1 +#endif +#else +#ifndef HIP_R_6F_E2M3_EXT +#define HIP_R_6F_E2M3_EXT 31 +#endif +#ifndef HIP_R_6F_E3M2_EXT +#define HIP_R_6F_E3M2_EXT 32 +#endif +#ifndef HIP_R_4F_E2M1_EXT +#define HIP_R_4F_E2M1_EXT 33 +#endif +#endif + int const HIP_R_8F_E5M3_EXT = 34; #endif /* _HIPBLASLT_TYPES_H_ */