From 612833bcfe53329d99dc44ea9f684e511b315ab6 Mon Sep 17 00:00:00 2001 From: kpyzhov Date: Tue, 20 Aug 2019 08:06:36 -0400 Subject: [PATCH] Corrected declaration of __ockl_clz_u64() (#1340) [ROCm/hip commit: 0e3198be250a17952c233e591f58d25aeeb4f86e] --- projects/hip/include/hip/hcc_detail/device_functions.h | 2 +- projects/hip/include/hip/hcc_detail/device_library_decls.h | 3 ++- 2 files changed, 3 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 465655680f..684449aa6b 100644 --- a/projects/hip/include/hip/hcc_detail/device_functions.h +++ b/projects/hip/include/hip/hcc_detail/device_functions.h @@ -50,7 +50,7 @@ __device__ static inline int __clz(int input) { } __device__ static inline int __clzll(long long int input) { - return __ockl_clz_u64((ulong)input); + return __ockl_clz_u64((ullong)input); } __device__ static inline unsigned int __ffs(unsigned int input) { diff --git a/projects/hip/include/hip/hcc_detail/device_library_decls.h b/projects/hip/include/hip/hcc_detail/device_library_decls.h index 2bf3c8cc51..4e9772c80a 100644 --- a/projects/hip/include/hip/hcc_detail/device_library_decls.h +++ b/projects/hip/include/hip/hcc_detail/device_library_decls.h @@ -34,6 +34,7 @@ typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; +typedef unsigned long long ullong; extern "C" __device__ __attribute__((const)) bool __ockl_wfany_i32(int); extern "C" __device__ __attribute__((const)) bool __ockl_wfall_i32(int); @@ -48,7 +49,7 @@ extern "C" __device__ __attribute__((const)) uint __ockl_sad_u32(uint, uint, uin extern "C" __device__ __attribute__((const)) uchar __ockl_clz_u8(uchar); extern "C" __device__ __attribute__((const)) ushort __ockl_clz_u16(ushort); extern "C" __device__ __attribute__((const)) uint __ockl_clz_u32(uint); -extern "C" __device__ __attribute__((const)) ulong __ockl_clz_u64(ulong); +extern "C" __device__ __attribute__((const)) ullong __ockl_clz_u64(ullong); extern "C" __device__ __attribute__((const)) float __ocml_floor_f32(float); extern "C" __device__ __attribute__((const)) float __ocml_rint_f32(float);