From 04c5bab9c6e42cd654b625560c33d8d671ae762c Mon Sep 17 00:00:00 2001 From: Yaxun Sam Liu Date: Fri, 7 Sep 2018 16:15:08 -0400 Subject: [PATCH] Add empty printf for hip-clang [ROCm/hip commit: 3e1833ca52b72dd9b0abef92b28e2b18391be8ae] --- projects/hip/include/hip/hcc_detail/hip_runtime.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/projects/hip/include/hip/hcc_detail/hip_runtime.h b/projects/hip/include/hip/hcc_detail/hip_runtime.h index 41710e4165..aecceea163 100644 --- a/projects/hip/include/hip/hcc_detail/hip_runtime.h +++ b/projects/hip/include/hip/hcc_detail/hip_runtime.h @@ -264,19 +264,16 @@ extern "C" __device__ void* __hip_hc_free(void* ptr); static inline __device__ void* malloc(size_t size) { return __hip_hc_malloc(size); } static inline __device__ void* free(void* ptr) { return __hip_hc_free(ptr); } -#ifdef __HCC_ACCELERATOR__ - -#ifdef HC_FEATURE_PRINTF +#if defined(__HCC_ACCELERATOR__) && defined(HC_FEATURE_PRINTF) template static inline __device__ void printf(const char* format, All... all) { hc::printf(format, all...); } -#else +#elif defined(__HCC_ACCELERATOR__) || __HIP__ template static inline __device__ void printf(const char* format, All... all) {} #endif -#endif #endif //__HCC_OR_HIP_CLANG__ #ifdef __HCC__