SWDEV-465236 - Changed RTCProgram::findIsa to not dlopen amdhip64 for static build

Change-Id: I322ef4ca96ea426a0953f1234e60db6cebb09886


[ROCm/clr commit: 7b0259c4b7]
Этот коммит содержится в:
Ioannis Assiouras
2024-06-10 13:58:27 +01:00
родитель 455ada60a2
Коммит 0a42617f58
2 изменённых файлов: 20 добавлений и 0 удалений
+1
Просмотреть файл
@@ -35,6 +35,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
if(BUILD_SHARED_LIBS)
add_library(hiprtc SHARED)
target_compile_definitions(hiprtc PRIVATE BUILD_SHARED_LIBS)
# 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 hiprtc POST_BUILD COMMAND ${CMAKE_STRIP} $<TARGET_FILE:hiprtc>)
+19
Просмотреть файл
@@ -65,6 +65,8 @@ RTCProgram::RTCProgram(std::string name) : name_(name) {
}
bool RTCProgram::findIsa() {
#ifdef BUILD_SHARED_LIBS
const char* libName;
#ifdef _WIN32
std::string dll_name = std::string("amdhip64_" + std::to_string(HIP_VERSION_MAJOR) + ".dll");
@@ -121,6 +123,23 @@ bool RTCProgram::findIsa() {
amd::Os::unloadLibrary(handle);
return true;
#else
int device;
hipError_t status = hipGetDevice(&device);
if (status != hipSuccess) {
return false;
}
hipDeviceProp_t props;
status = hipGetDeviceProperties(&props, device);
if (status != hipSuccess) {
return false;
}
isa_ = "amdgcn-amd-amdhsa--";
isa_.append(props.gcnArchName);
return true;
#endif
}
// RTC Compile Program Member Functions