From 6b8218e5a0ae78d29720ed6f92ba7cfcdec58fe2 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 30 May 2018 06:38:41 -0400 Subject: [PATCH] Add more function declarations for hip-clang --- include/hip/hcc_detail/hip_runtime.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/hip/hcc_detail/hip_runtime.h b/include/hip/hcc_detail/hip_runtime.h index 1e469f5d03..9737ecb19f 100644 --- a/include/hip/hcc_detail/hip_runtime.h +++ b/include/hip/hcc_detail/hip_runtime.h @@ -390,7 +390,7 @@ __device__ void __threadfence_system(void); * @} */ -#endif // __HCC_OR_CLANG__ +#endif // __HCC_OR_HIP_CLANG__ #if defined __HCC__ @@ -437,6 +437,8 @@ static constexpr Coordinates threadIdx; #define hipGridDim_y (hc_get_num_groups(1)) #define hipGridDim_z (hc_get_num_groups(2)) +#endif // defined __HCC__ +#if __HCC_OR_HIP_CLANG__ extern "C" __device__ void* __hip_hc_memcpy(void* dst, const void* src, size_t size); extern "C" __device__ void* __hip_hc_memset(void* ptr, uint8_t val, size_t size); extern "C" __device__ void* __hip_hc_malloc(size_t); @@ -472,7 +474,9 @@ static inline __device__ void printf(const char* format, All... all) {} #define __syncthreads() hc_barrier(CLK_LOCAL_MEM_FENCE) +#endif //__HCC_OR_HIP_CLANG__ +#ifdef __HCC__ #define HIP_KERNEL_NAME(...) (__VA_ARGS__) #define HIP_SYMBOL(X) #X @@ -652,8 +656,6 @@ __DEVICE__ void inline __assert_fail(const char * __assertion, __device_trap(); } -__DEVICE__ void __syncthreads(); - #pragma push_macro("__DEVICE__") #include