diff options
author | Tianhao Chai <cth451> | 2022-07-29 15:48:52 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-29 15:57:09 +0300 |
commit | b862cf0b9fc72a9f2b154bce0163558f577e3f58 (patch) | |
tree | ce8dfb8ea9da5fe6d072a778f404a193b0986c3a /intern | |
parent | ae0b8e904c8b80aedd743a8a36a53494e37a8fbf (diff) |
Fix Cycles build error with CUDA on arm64
Checking arm64 assembly support before CUDA/Metal would cause NVCC to
generate inline arm64 assembly.
Differential Revision: https://developer.blender.org/D15569
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/util/math.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/util/math.h b/intern/cycles/util/math.h index 2631304c84b..f6400cb879f 100644 --- a/intern/cycles/util/math.h +++ b/intern/cycles/util/math.h @@ -953,7 +953,11 @@ ccl_device_inline uint prev_power_of_two(uint x) ccl_device_inline uint32_t reverse_integer_bits(uint32_t x) { /* Use a native instruction if it exists. */ -#if defined(__aarch64__) || defined(_M_ARM64) +#if defined(__KERNEL_CUDA__) + return __brev(x); +#elif defined(__KERNEL_METAL__) + return reverse_bits(x); +#elif defined(__aarch64__) || defined(_M_ARM64) /* Assume the rbit is always available on 64bit ARM architecture. */ __asm__("rbit %w0, %w1" : "=r"(x) : "r"(x)); return x; @@ -962,10 +966,6 @@ ccl_device_inline uint32_t reverse_integer_bits(uint32_t x) * This 32-bit Thumb instruction is available in ARMv6T2 and above. */ __asm__("rbit %0, %1" : "=r"(x) : "r"(x)); return x; -#elif defined(__KERNEL_CUDA__) - return __brev(x); -#elif defined(__KERNEL_METAL__) - return reverse_bits(x); #elif __has_builtin(__builtin_bitreverse32) return __builtin_bitreverse32(x); #else |