From 1692817b5e205f0469f67bb3dfbaedd329961555 Mon Sep 17 00:00:00 2001 From: Zhou Qiankang Date: Tue, 17 Jun 2025 20:18:00 +0200 Subject: [PATCH 1/2] Fix: Wrong HIP device pointer size on riscv64 and loongarcg64 Add __LP64__ to 64-bit platform detection, to ensure hipDeviceptr_t has the correct size on these platforms. Pull Request: https://projects.blender.org/blender/blender/pulls/140528 --- extern/hipew/include/hipew.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/hipew/include/hipew.h b/extern/hipew/include/hipew.h index e87daaec213..963c5092f0b 100644 --- a/extern/hipew/include/hipew.h +++ b/extern/hipew/include/hipew.h @@ -87,7 +87,7 @@ typedef uint32_t hipuint32_t; typedef uint64_t hipuint64_t; #endif -#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(_M_ARM64) || defined(__ppc64__) || defined(__PPC64__) +#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(_M_ARM64) || defined(__ppc64__) || defined(__PPC64__) || defined(__LP64__) typedef unsigned long long hipDeviceptr_t; #else typedef unsigned int hipDeviceptr_t; From 3999975c29e273d6848218ca0f00a4548e196e23 Mon Sep 17 00:00:00 2001 From: wszqkzqk Date: Tue, 17 Jun 2025 20:20:26 +0200 Subject: [PATCH 2/2] Build: Add loong64 support in BLI_build_config.h LoongArch is a new RISC ISA developed by Loongson, this adds the missing entry to BLI_build_config.h. It has been verified to work on Arch Linux's loong64 port. Pull Request: https://projects.blender.org/blender/blender/pulls/130916 --- source/blender/blenlib/BLI_build_config.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/blender/blenlib/BLI_build_config.h b/source/blender/blenlib/BLI_build_config.h index dff2096ffd2..bbbb75edf33 100644 --- a/source/blender/blenlib/BLI_build_config.h +++ b/source/blender/blenlib/BLI_build_config.h @@ -357,6 +357,11 @@ # else # define ARCH_CPU_BIG_ENDIAN 1 # endif +#elif defined(__loongarch_lp64) +# define ARCH_CPU_LOONG_FAMILY 1 +# define ARCH_CPU_LOONG64 1 +# define ARCH_CPU_64_BITS 1 +# define ARCH_CPU_LITTLE_ENDIAN 1 #else # error Please add support for your architecture in BLI_build_config.h #endif @@ -399,6 +404,9 @@ #if !defined(ARCH_CPU_RISCV_FAMILY) # define ARCH_CPU_RISCV_FAMILY 0 #endif +#if !defined(ARCH_CPU_LOONG_FAMILY) +# define ARCH_CPU_LOONG_FAMILY 0 +#endif #if !defined(ARCH_CPU_ARM64) # define ARCH_CPU_ARM64 0 @@ -442,5 +450,8 @@ #if !defined(ARCH_CPU_RISCV128) # define ARCH_CPU_RISCV128 0 #endif +#if !defined(ARCH_CPU_LOONG64) +# define ARCH_CPU_LOONG64 0 +#endif /** \} */