From b53fcb4d0280b0bcbc783dd619249c7708b6f36e Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 11 Jan 2024 12:08:09 -0800 Subject: [PATCH] SWDEV-440718 - Suffix hip bin name with _6. Link to amd_comgr_2.dll Change-Id: I5d21af0cc91f2082099273f75ebe1c3279b6365d --- hipamd/src/CMakeLists.txt | 3 +++ hipamd/src/hiprtc/hiprtcInternal.cpp | 3 ++- rocclr/device/comgrctx.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hipamd/src/CMakeLists.txt b/hipamd/src/CMakeLists.txt index b038fd72dc..b2bf28bbaa 100644 --- a/hipamd/src/CMakeLists.txt +++ b/hipamd/src/CMakeLists.txt @@ -59,6 +59,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") if(BUILD_SHARED_LIBS) add_library(amdhip64 SHARED) + if(WIN32) + set_target_properties(amdhip64 PROPERTIES RUNTIME_OUTPUT_NAME "amdhip64_${HIP_VERSION_MAJOR}") + endif() # Windows doesn't have a strip utility, so CMAKE_STRIP won't be set. if((CMAKE_BUILD_TYPE STREQUAL "Release") AND NOT ("${CMAKE_STRIP}" STREQUAL "")) add_custom_command(TARGET amdhip64 POST_BUILD COMMAND ${CMAKE_STRIP} $) diff --git a/hipamd/src/hiprtc/hiprtcInternal.cpp b/hipamd/src/hiprtc/hiprtcInternal.cpp index 89aa9064e5..ac02aa1070 100644 --- a/hipamd/src/hiprtc/hiprtcInternal.cpp +++ b/hipamd/src/hiprtc/hiprtcInternal.cpp @@ -59,7 +59,8 @@ RTCProgram::RTCProgram(std::string name) : name_(name) { bool RTCProgram::findIsa() { const char* libName; #ifdef _WIN32 - libName = "amdhip64.dll"; + std::string dll_name = std::string("amdhip64_" + std::to_string(HIP_VERSION_MAJOR) + ".dll"); + libName = dll_name.c_str(); #else libName = "libamdhip64.so"; #endif diff --git a/rocclr/device/comgrctx.cpp b/rocclr/device/comgrctx.cpp index 67184ca944..1a8afe60a9 100644 --- a/rocclr/device/comgrctx.cpp +++ b/rocclr/device/comgrctx.cpp @@ -57,9 +57,11 @@ bool Comgr::LoadLib(bool is_versioned) { cep_.handle = Os::loadLibrary(comgr_lib_name); #endif } else { - static constexpr const char* comgr_lib_name = + std::string comgr_major_dll = "amd_comgr_" + + std::to_string(AMD_COMGR_INTERFACE_VERSION_MAJOR) + ".dll"; + static const char* comgr_lib_name = LP64_SWITCH(WINDOWS_SWITCH("amd_comgr32.dll", "libamd_comgr32.so.2"), - WINDOWS_SWITCH("amd_comgr.dll", "libamd_comgr.so.2")); + WINDOWS_SWITCH(comgr_major_dll.c_str(), "libamd_comgr.so.2")); cep_.handle = Os::loadLibrary(comgr_lib_name); } if (nullptr == cep_.handle) {