Update the `hsa.h` header to use the gcc / clang `__BYTE_ORDER__`
macros where available to more accurately autodetect endianness for
the target.

Change-Id: I7312f3badcba9287a30eb14882b91e2a247acc5f


[ROCm/ROCR-Runtime commit: 4971150576]
Этот коммит содержится в:
Joseph Huber authored and David Yat Sin committed 2024-01-16 21:29:39 +00:00
1 родитель 9317d0fbc0
Коммит 298e6cc495
1 file changed
+6 -2
+6 -2
Просмотреть файл
@@ -79,8 +79,12 @@
// Try to detect CPU endianness
#if !defined(LITTLEENDIAN_CPU) && !defined(BIGENDIAN_CPU)
#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \
defined(_M_X64) || defined(__loongarch64) || defined(__riscv)
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
#define LITTLEENDIAN_CPU
#elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#define BIGENDIAN_CPU
#elif defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \
defined(_M_X64) || defined(__loongarch64) || defined(__riscv)
#define LITTLEENDIAN_CPU
#endif
#endif