From 55ffe73ba9dd4e3d2eaafa3ad3c35def8f2c62cc Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Sun, 18 Jun 2023 05:54:24 -0700 Subject: [PATCH] add uint64_t variant for __ffsll When building blender there is this error /usr/include/nanovdb/NanoVDB.h:1880:12: error: call to '__ffsll' is ambiguous return __ffsll(v); ^~~~~~~ /usr/include/hip/amd_detail/amd_device_functions.h:70:39: note: candidate function __device__ static inline unsigned int __ffsll(unsigned long long int input) { ^ /usr/include/hip/amd_detail/amd_device_functions.h:78:39: note: candidate function __device__ static inline unsigned int __ffsll(long long int input) { The original type is unit64_t, so add it as a variant Signed-off-by: Tom Rix --- include/hip/amd_detail/amd_device_functions.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hip/amd_detail/amd_device_functions.h b/include/hip/amd_detail/amd_device_functions.h index 1a4900db..4e6aa50d 100644 --- a/hipamd/include/hip/amd_detail/amd_device_functions.h +++ b/hipamd/include/hip/amd_detail/amd_device_functions.h @@ -79,6 +79,10 @@ __device__ static inline unsigned int __ffsll(long long int input) { return ( input == 0 ? -1 : __builtin_ctzll(input) ) + 1; } +__device__ static inline unsigned int __ffsll(uint64_t input) { + return ( input == 0 ? -1 : __builtin_ctzll(input) ) + 1; +} + // Given a 32/64-bit value exec mask and an integer value base (between 0 and WAVEFRONT_SIZE), // find the n-th (given by offset) set bit in the exec mask from the base bit, and return the bit position. // If not found, return -1. -- 2.41.0.rc2