Fix MIOpen build failure

This is charrypick of 9ead991784
and https://github.com/ROCm-Developer-Tools/HIP/pull/2009

Fix cmake config file

Removed cmake target files under packaging directory.

Merged cmake config .in files for HIP-Clang and HCC as one.

Use cmake generated target files in both install and packaging.

This makes cmake config file consistent for make install and
make package.

Let device side malloc/free return nullptr and trap

Change-Id: I448f3ea2d4934648089bad371debc203f895cba6
이 커밋은 다음에 포함됨:
Yaxun (Sam) Liu가 2020-04-13 23:01:31 -04:00를 커밋했습니다
1 부모 a9513154c7
커밋 4e1d05c4be
12 파일이 변경됨
+195 -423

검색과 일치하는 파일 없음

+1 -1
파일 보기
@@ -27,7 +27,7 @@ THE SOFTWARE.
// HIP heap is implemented as a global array with fixed size. Users may define
// __HIP_SIZE_OF_PAGE and __HIP_NUM_PAGES to have a larger heap.
#if __HCC__ || __HIP__
#if (__HCC__ || __HIP__) && __HIP_ENABLE_MALLOC__
// Size of page in bytes.
#ifndef __HIP_SIZE_OF_PAGE
+10 -1
파일 보기
@@ -44,6 +44,11 @@ THE SOFTWARE.
#include <stddef.h>
#endif //__cplusplus
// __hip_malloc is not working. Disable it by default.
#ifndef __HIP_ENABLE_MALLOC__
#define __HIP_ENABLE_MALLOC__ 0
#endif
#if __HCC_OR_HIP_CLANG__
#if __HIP__
@@ -308,11 +313,15 @@ static constexpr Coordinates<hip_impl::WorkitemId> threadIdx{};
#endif // defined __HCC__
#if __HCC_OR_HIP_CLANG__
#if __HIP_ENABLE_MALLOC__
extern "C" __device__ void* __hip_malloc(size_t);
extern "C" __device__ void* __hip_free(void* ptr);
static inline __device__ void* malloc(size_t size) { return __hip_malloc(size); }
static inline __device__ void* free(void* ptr) { return __hip_free(ptr); }
#else
static inline __device__ void* malloc(size_t size) { __builtin_trap(); return nullptr; }
static inline __device__ void* free(void* ptr) { __builtin_trap(); return nullptr; }
#endif
#endif //__HCC_OR_HIP_CLANG__