From e4635c36a0cb5d16cd98a6273099612eadc8b5e3 Mon Sep 17 00:00:00 2001 From: streamhsa Date: Tue, 2 Feb 2016 15:05:46 +0530 Subject: [PATCH] ADDED Support for __ffs() and __ffsll() having signed input -sandeep [ROCm/hip commit: 23904df99bad23d1d0ee5d99b83cd69baea1956b] --- projects/hip/include/hcc_detail/hip_runtime.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/projects/hip/include/hcc_detail/hip_runtime.h b/projects/hip/include/hcc_detail/hip_runtime.h index 734596a476..62386a14a2 100644 --- a/projects/hip/include/hcc_detail/hip_runtime.h +++ b/projects/hip/include/hcc_detail/hip_runtime.h @@ -325,6 +325,16 @@ __device__ inline unsigned int __ffsll(unsigned long long int input) return hc::__lastbit_u32_u64( input)+1; } +__device__ inline unsigned int __ffs(int input) +{ + return hc::__lastbit_u32_s32( input)+1; +} + +__device__ inline unsigned int __ffsll(long long int input) +{ + return hc::__lastbit_u32_s64( input)+1; +} + __device__ inline unsigned int __brev( unsigned int input) { return hc::__bitrev_b32( input);