Fix building mathlibs failure

Add back
__HIP_PLATFORM_HCC__
__HIP_PLATFORM_NVCC__

Change-Id: I1ae48678eafd849d6c25bcb204c1724b026be22f


[ROCm/clr commit: 8fc1ff7d4f]
此提交包含在:
Tao Sang
2021-01-13 11:46:42 -05:00
提交者 Tao Sang
父節點 7d42f2535d
當前提交 52954de0eb
共有 3 個檔案被更改,包括 14 行新增3 行删除
+2 -2
查看文件
@@ -48,11 +48,11 @@ if ($HIP_COMPILER eq "clang") {
$HIP_CLANG_VERSION=~/.*clang version (\S+).*/;
$HIP_CLANG_VERSION=$1;
$CPP_CONFIG = " -D__HIP_PLATFORM_AMD__= -I$HIP_PATH/include -I$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION -I$HSA_PATH/include";
$CPP_CONFIG = " -D__HIP_PLATFORM_HCC__= -D__HIP_PLATFORM_AMD__= -I$HIP_PATH/include -I$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION -I$HSA_PATH/include";
}
if ($HIP_PLATFORM eq "nvidia") {
$CPP_CONFIG = " -D__HIP_PLATFORM_NVIDIA__= -I$HIP_PATH/include -I$CUDA_PATH/include";
$CPP_CONFIG = " -D__HIP_PLATFORM_NVCC__= -D__HIP_PLATFORM_NVIDIA__= -I$HIP_PATH/include -I$CUDA_PATH/include";
};
if ($p_help) {
+1 -1
查看文件
@@ -119,7 +119,7 @@ endif()
# Right now this is only supported for amd platforms
set_target_properties(hip::host PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "__HIP_PLATFORM_AMD__=1"
INTERFACE_COMPILE_DEFINITIONS "__HIP_PLATFORM_HCC__=1;__HIP_PLATFORM_AMD__=1"
)
if(HIP_RUNTIME MATCHES "rocclr")
+11
查看文件
@@ -27,6 +27,11 @@ THE SOFTWARE.
// Auto enable __HIP_PLATFORM_AMD__ if compiling on AMD platform
// Other compiler (GCC,ICC,etc) need to set one of these macros explicitly
#if defined(__clang__) && defined(__HIP__)
// The following macro will be removed after upstream updation
#ifndef __HIP_PLATFORM_HCC__
#define __HIP_PLATFORM_HCC__
#endif
#ifndef __HIP_PLATFORM_AMD__
#define __HIP_PLATFORM_AMD__
#endif
@@ -34,9 +39,15 @@ THE SOFTWARE.
// Auto enable __HIP_PLATFORM_NVIDIA__ if compiling with NVIDIA platform
#if defined(__NVCC__) || (defined(__clang__) && defined(__CUDA__) && !defined(__HIP__))
// The following macro will be removed after upstream updation
#ifndef __HIP_PLATFORM_NVCC__
#define __HIP_PLATFORM_NVCC__
#endif
#ifndef __HIP_PLATFORM_NVIDIA__
#define __HIP_PLATFORM_NVIDIA__
#endif
#ifdef __CUDACC__
#define __HIPCC__
#endif