SWDEV-465236 - Changed RTCProgram::findIsa to not dlopen amdhip64 for static build
Change-Id: I322ef4ca96ea426a0953f1234e60db6cebb09886
[ROCm/clr commit: 7b0259c4b7]
Этот коммит содержится в:
@@ -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>)
|
||||
|
||||
@@ -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
|
||||
|
||||
Ссылка в новой задаче
Block a user