From 53b232fb2ab2ea1e0cf615f0075d174790806e58 Mon Sep 17 00:00:00 2001 From: Konstantin Pyzhov Date: Thu, 18 Apr 2019 13:07:24 -0400 Subject: [PATCH] Fix for __ffsll() device functions. [ROCm/hip commit: b7bd29924a6bdecb873386cc95ae77f2a15c15c7] --- projects/hip/include/hip/hcc_detail/device_functions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/hip/include/hip/hcc_detail/device_functions.h b/projects/hip/include/hip/hcc_detail/device_functions.h index b88df2e168..7cb9406856 100644 --- a/projects/hip/include/hip/hcc_detail/device_functions.h +++ b/projects/hip/include/hip/hcc_detail/device_functions.h @@ -58,7 +58,7 @@ __device__ static inline unsigned int __ffs(unsigned int input) { } __device__ static inline unsigned int __ffsll(unsigned long long int input) { - return ( input == 0 ? -1 : __builtin_ctzl(input) ) + 1; + return ( input == 0 ? -1 : __builtin_ctzll(input) ) + 1; } __device__ static inline unsigned int __ffs(int input) { @@ -66,7 +66,7 @@ __device__ static inline unsigned int __ffs(int input) { } __device__ static inline unsigned int __ffsll(long long int input) { - return ( input == 0 ? -1 : __builtin_ctzl(input) ) + 1; + return ( input == 0 ? -1 : __builtin_ctzll(input) ) + 1; } __device__ static inline unsigned int __brev(unsigned int input) {