Fix static lib crashing issue

Initialize HIP_ENABLE_DEFERRED_LOADING = 1

Change-Id: I432ccf1926b953c4391fdd086cde7da2380962bb


[ROCm/hip commit: 0eebbb4f87]
Este commit está contenido en:
Tao Sang
2020-06-21 09:57:24 -04:00
cometido por Tao Sang
padre 49dfc5b2bd
commit 9c6dbda74b
+4 -7
Ver fichero
@@ -29,6 +29,7 @@
#include "elfio.hpp"
constexpr unsigned __hipFatMAGIC2 = 0x48495046; // "HIPF"
int HIP_ENABLE_DEFERRED_LOADING = 1; // Will check later
thread_local std::stack<ihipExec_t> execStack_;
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);
}
namespace {
const int HIP_ENABLE_DEFERRED_LOADING{[] () {
char *var = getenv("HIP_ENABLE_DEFERRED_LOADING");
return var ? atoi(var) : 1;
}()};
} /* namespace */
extern "C" void __hipRegisterFunction(
hip::FatBinaryInfoType* modules,
const void* hostFunction,
@@ -910,6 +904,9 @@ void PlatformState::init()
}
initialized_ = true;
char *var = getenv("HIP_ENABLE_DEFERRED_LOADING");
HIP_ENABLE_DEFERRED_LOADING = var ? atoi(var) : 1;
for (auto& it : statCO_.modules_) {
digestFatBinary(it.first, it.second);
}