diff --git a/projects/clr/hipamd/hip-config-amd.cmake b/projects/clr/hipamd/hip-config-amd.cmake index 601cc57fdf..7c86f2586c 100755 --- a/projects/clr/hipamd/hip-config-amd.cmake +++ b/projects/clr/hipamd/hip-config-amd.cmake @@ -84,7 +84,7 @@ endif() set(_IMPORT_PREFIX ${HIP_PACKAGE_PREFIX_DIR}) # 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" ) set_target_properties(hip::amdhip64 PROPERTIES diff --git a/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime_pt_api.h b/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime_pt_api.h index be4118d0c1..a597dbd03b 100644 --- a/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime_pt_api.h +++ b/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime_pt_api.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_HIP_RUNTIME_PT_API_H #define HIP_INCLUDE_HIP_HIP_RUNTIME_PT_API_H -#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__) +#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__)) /// hipStreamPerThread implementation #if defined(HIP_API_PER_THREAD_DEFAULT_STREAM) @@ -192,5 +192,5 @@ hipError_t hipLaunchHostFunc_spt(hipStream_t stream, hipHostFn_t fn, void* userD } #endif // extern "C" -#endif //defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__) +#endif //(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__)) #endif //HIP_INCLUDE_HIP_HIP_RUNTIME_PT_API_H diff --git a/projects/clr/hipamd/include/hip/amd_detail/host_defines.h b/projects/clr/hipamd/include/hip/amd_detail/host_defines.h index 0fad2b4704..8caed1d182 100644 --- a/projects/clr/hipamd/include/hip/amd_detail/host_defines.h +++ b/projects/clr/hipamd/include/hip/amd_detail/host_defines.h @@ -28,6 +28,10 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_AMD_DETAIL_HOST_DEFINES_H #define HIP_INCLUDE_HIP_AMD_DETAIL_HOST_DEFINES_H +// The follow macro should be removed after upstream updation. +// It's defined here for workarround of rocThrust building failure. +#define HIP_INCLUDE_HIP_HCC_DETAIL_HOST_DEFINES_H + // Add guard to Generic Grid Launch method #ifndef GENERIC_GRID_LAUNCH #define GENERIC_GRID_LAUNCH 1 diff --git a/projects/clr/hipamd/include/hip/hcc_detail b/projects/clr/hipamd/include/hip/hcc_detail new file mode 120000 index 0000000000..4931d48978 --- /dev/null +++ b/projects/clr/hipamd/include/hip/hcc_detail @@ -0,0 +1 @@ +amd_detail \ No newline at end of file diff --git a/projects/clr/hipamd/include/hip/nvcc_detail b/projects/clr/hipamd/include/hip/nvcc_detail new file mode 120000 index 0000000000..e02ee85e4c --- /dev/null +++ b/projects/clr/hipamd/include/hip/nvcc_detail @@ -0,0 +1 @@ +nvidia_detail \ No newline at end of file diff --git a/projects/clr/hipamd/packaging/hip-devel.postinst b/projects/clr/hipamd/packaging/hip-devel.postinst index 9887cb9a0e..9b32b08854 100755 --- a/projects/clr/hipamd/packaging/hip-devel.postinst +++ b/projects/clr/hipamd/packaging/hip-devel.postinst @@ -21,6 +21,18 @@ ROCMDIR=@ROCM_PATH@ HIPINCDIR=$ROCMDIR/@CMAKE_INSTALL_INCLUDEDIR@/hip CURRENTDIR=`pwd` +# The following will be removed after upstream updation +cd $HIPINCDIR +ln -r -s -f amd_detail hcc_detail +ln -r -s -f nvidia_detail nvcc_detail +cd $CURRENTDIR #FILE_REORG_BACKWARD_COMPATIBILITY HIPINCDIR=$ROCMDIR/hip/include/hip +if [ -d $HIPINCDIR ]; then + # The following will be removed after upstream updation + cd $HIPINCDIR + ln -r -s -f amd_detail hcc_detail + ln -r -s -f nvidia_detail nvcc_detail + cd $CURRENTDIR +fi diff --git a/projects/clr/hipamd/packaging/hip-devel.prerm b/projects/clr/hipamd/packaging/hip-devel.prerm index c8b7114f3f..9dabd4d452 100755 --- a/projects/clr/hipamd/packaging/hip-devel.prerm +++ b/projects/clr/hipamd/packaging/hip-devel.prerm @@ -23,11 +23,19 @@ CURRENTDIR=`pwd` HIPINCDIR=$ROCMDIR/@CMAKE_INSTALL_INCLUDEDIR@/hip ([ ! -d $HIPINCDIR ]) && exit 0 +cd $HIPINCDIR +rm hcc_detail +rm nvcc_detail +cd $CURRENTDIR #FILE_REORG_BACKWARD_COMPATIBILITY #backward copatibility code , to be removed later HIPDIR=$ROCMDIR/hip HIPINCDIR=$ROCMDIR/hip/include/hip ([ ! -d $HIPINCDIR ]) && exit 0 +cd $HIPINCDIR +rm -f hcc_detail +rm -f nvcc_detail +cd $CURRENTDIR ([ ! -d $HIPDIR ]) && exit 0 rmdir --ignore-fail-on-non-empty $HIPDIR