Fix static lib crashing issue
Initialize HIP_ENABLE_DEFERRED_LOADING = 1
Change-Id: I432ccf1926b953c4391fdd086cde7da2380962bb
[ROCm/clr commit: d536a661ac]
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include "elfio.hpp"
|
#include "elfio.hpp"
|
||||||
|
|
||||||
constexpr unsigned __hipFatMAGIC2 = 0x48495046; // "HIPF"
|
constexpr unsigned __hipFatMAGIC2 = 0x48495046; // "HIPF"
|
||||||
|
int HIP_ENABLE_DEFERRED_LOADING = 1; // Will check later
|
||||||
|
|
||||||
thread_local std::stack<ihipExec_t> execStack_;
|
thread_local std::stack<ihipExec_t> execStack_;
|
||||||
PlatformState* PlatformState::platform_; // Initiaized as nullptr by default
|
PlatformState* PlatformState::platform_; // Initiaized as nullptr by default
|
||||||
@@ -130,13 +131,6 @@ bool CL_CALLBACK getSvarInfo(cl_program program, std::string var_name, void** va
|
|||||||
var_addr, var_size);
|
var_addr, var_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
const int HIP_ENABLE_DEFERRED_LOADING{[] () {
|
|
||||||
char *var = getenv("HIP_ENABLE_DEFERRED_LOADING");
|
|
||||||
return var ? atoi(var) : 1;
|
|
||||||
}()};
|
|
||||||
} /* namespace */
|
|
||||||
|
|
||||||
extern "C" void __hipRegisterFunction(
|
extern "C" void __hipRegisterFunction(
|
||||||
hip::FatBinaryInfoType* modules,
|
hip::FatBinaryInfoType* modules,
|
||||||
const void* hostFunction,
|
const void* hostFunction,
|
||||||
@@ -910,6 +904,9 @@ void PlatformState::init()
|
|||||||
}
|
}
|
||||||
initialized_ = true;
|
initialized_ = true;
|
||||||
|
|
||||||
|
char *var = getenv("HIP_ENABLE_DEFERRED_LOADING");
|
||||||
|
HIP_ENABLE_DEFERRED_LOADING = var ? atoi(var) : 1;
|
||||||
|
|
||||||
for (auto& it : statCO_.modules_) {
|
for (auto& it : statCO_.modules_) {
|
||||||
digestFatBinary(it.first, it.second);
|
digestFatBinary(it.first, it.second);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user