diff --git a/projects/clr/hipamd/packaging/hip-targets-release.cmake b/projects/clr/hipamd/packaging/hip-targets-release.cmake index 36e9c6e9e5..c45af51bac 100644 --- a/projects/clr/hipamd/packaging/hip-targets-release.cmake +++ b/projects/clr/hipamd/packaging/hip-targets-release.cmake @@ -32,20 +32,28 @@ endif() # Import target "hip::hip_hcc" for configuration "Release" set_property(TARGET hip::hip_hcc APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) if(HIP_COMPILER STREQUAL "clang") -set_target_properties(hip::hip_hcc PROPERTIES - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libhip_hcc.so" - IMPORTED_SONAME_RELEASE "libhip_hcc.so" - ) + if(HIP_RUNTIME STREQUAL "vdi") + set_target_properties(hip::amdhip64 PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libamdhip64.so" + IMPORTED_SONAME_RELEASE "libamdhip64.so") + else() + set_target_properties(hip::hip_hcc PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libhip_hcc.so" + IMPORTED_SONAME_RELEASE "libhip_hcc.so") + endif() else() -set_target_properties(hip::hip_hcc PROPERTIES - IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "hcc::hccrt;hcc::hc_am" - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libhip_hcc.so" - IMPORTED_SONAME_RELEASE "libhip_hcc.so" - ) + set_target_properties(hip::hip_hcc PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "hcc::hccrt;hcc::hc_am" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libhip_hcc.so" + IMPORTED_SONAME_RELEASE "libhip_hcc.so") endif() -list(APPEND _IMPORT_CHECK_TARGETS hip::hip_hcc ) -list(APPEND _IMPORT_CHECK_FILES_FOR_hip::hip_hcc "${_IMPORT_PREFIX}/lib/libhip_hcc.so" ) - +if(NOT HIP_RUNTIME STREQUAL "vdi") + list(APPEND _IMPORT_CHECK_TARGETS hip::hip_hcc ) + list(APPEND _IMPORT_CHECK_FILES_FOR_hip::hip_hcc "${_IMPORT_PREFIX}/lib/libhip_hcc.so" ) +else() + list(APPEND _IMPORT_CHECK_TARGETS hip::amdhip64) + list(APPEND _IMPORT_CHECK_FILES_FOR_hip::amdhip64 "${_IMPORT_PREFIX}/lib/libamdhip64.so" ) +endif() # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) diff --git a/projects/clr/hipamd/packaging/hip-targets.cmake b/projects/clr/hipamd/packaging/hip-targets.cmake index 4d44579277..095c7cf62c 100644 --- a/projects/clr/hipamd/packaging/hip-targets.cmake +++ b/projects/clr/hipamd/packaging/hip-targets.cmake @@ -68,26 +68,39 @@ find_path(HSA_HEADER hsa/hsa.h if (HSA_HEADER-NOTFOUND) message (FATAL_ERROR "HSA header not found! ROCM_PATH environment not set") endif() -if(NOT HIP_RUNTIME STREQUAL "vdi") +if(HIP_RUNTIME STREQUAL "vdi") + # Create imported target hip::amdhip64 + add_library(hip::amdhip64 SHARED IMPORTED) + + set_target_properties(hip::amdhip64 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" + ) +else() set_target_properties(hip::hip_hcc_static PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}") + + # Create imported target hip::hip_hcc + add_library(hip::hip_hcc SHARED IMPORTED) + + set_target_properties(hip::hip_hcc PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" + ) endif() -# Create imported target hip::hip_hcc -add_library(hip::hip_hcc SHARED IMPORTED) - -set_target_properties(hip::hip_hcc PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" - INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" -) - # Create imported target hip::host add_library(hip::host INTERFACE IMPORTED) -set_target_properties(hip::host PROPERTIES - INTERFACE_LINK_LIBRARIES "hip::hip_hcc" -) +if(HIP_RUNTIME STREQUAL "vdi") + set_target_properties(hip::host PROPERTIES + INTERFACE_LINK_LIBRARIES "hip::amdhip64") +else() + set_target_properties(hip::host PROPERTIES + INTERFACE_LINK_LIBRARIES "hip::hip_hcc") +endif() + # Create imported target hip::device add_library(hip::device INTERFACE IMPORTED)