Fix header for OpenMP AMDGCN support

Add ifndef for __OPENMP_AMDGCN__ target, which shares
these header files with HIP.

Change-Id: I720693cfbcfb7836cd2f361d48530fb55ee3557a
This commit is contained in:
Aaron En Ye Shi
2020-10-19 17:59:34 +00:00
committed by Aaron En Ye Shi
parent f79a03026c
commit 2005c3437e
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -1410,6 +1410,7 @@ static inline __device__ void* __hip_hc_memset(void* dst, unsigned char val, siz
return dst;
}
#ifndef __OPENMP_AMDGCN__
static inline __device__ void* memcpy(void* dst, const void* src, size_t size) {
return __hip_hc_memcpy(dst, src, size);
}
@@ -1418,5 +1419,5 @@ static inline __device__ void* memset(void* ptr, int val, size_t size) {
unsigned char val8 = static_cast<unsigned char>(val);
return __hip_hc_memset(ptr, val8, size);
}
#endif // !__OPENMP_AMDGCN__
#endif
+3
View File
@@ -312,6 +312,8 @@ static constexpr Coordinates<hip_impl::WorkitemId> threadIdx{};
#define hipGridDim_z (hc_get_num_groups(2))
#endif // defined __HCC__
#ifndef __OPENMP_AMDGCN__
#if __HCC_OR_HIP_CLANG__
#if !__CLANG_HIP_RUNTIME_WRAPPER_INCLUDED__
#if __HIP_ENABLE_DEVICE_MALLOC__
@@ -325,6 +327,7 @@ static inline __device__ void* free(void* ptr) { __builtin_trap(); return nullpt
#endif
#endif // !__CLANG_HIP_RUNTIME_WRAPPER_INCLUDED__
#endif //__HCC_OR_HIP_CLANG__
#endif // !__OPENMP_AMDGCN__
#ifdef __HCC__