From b68eb64ca195f60bf1ae3c79a757984397c1f6b4 Mon Sep 17 00:00:00 2001 From: Piyush Sachdeva Date: Fri, 1 Mar 2024 14:43:26 +0530 Subject: [PATCH] Adding definition for ENDIAN macros Due to the missing definition of custom macros i.e. `LITTLEENDIAN_CPU` and `BIGENDIAN_CPU`, rccl package (uses this library) fails to build on ppc64el. This patch defines the missing macros based on the endianess of the machine as exposed by system's header files. Signed-off-by: Piyush Sachdeva --- include/hsa.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/hsa.h b/include/hsa.h index 563c6a0..129a28b 100644 --- a/include/hsa.h +++ b/include/hsa.h @@ -81,6 +81,13 @@ #define HSA_LARGE_MODEL #endif +// Definition of ENDIANESS macros. +#if defined(__BIG_ENDIAN) && !defined(BIGENDIAN_CPU) +#define BIGENDIAN_CPU +#elif defined(__LITTLE_ENDIAN) && !defined(LITTLEENDIAN_CPU) +#define LITTLEENDIAN_CPU +#endif + // Try to detect CPU endianness #if !defined(LITTLEENDIAN_CPU) && !defined(BIGENDIAN_CPU) #if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \