load functions when registered if lazy load is disabled

Change-Id: I6f10a72f7643e476407af03b04ef52e59741be45


[ROCm/hip commit: a5b4f5f02d]
이 커밋은 다음에 포함됨:
Payam 작성하고 Payam Ghafari가 2020-05-15 12:15:32 -04:00를 커밋함
1 부모 8fd47616be
커밋 bfea574271
1 파일이 변경됨
+6 -10
+6 -10
파일 보기
@@ -191,13 +191,6 @@ void PlatformState::init()
for (auto& it : vars_) {
it.second.rvars.resize(g_devices.size());
}
if (!HIP_ENABLE_LAZY_KERNEL_LOADING) {
for (size_t i = 0; i < g_devices.size(); ++i) {
for (auto& it: functions_) {
getFunc(it.first, i);
}
}
}
}
bool PlatformState::unregisterFunc(hipModule_t hmod) {
@@ -613,9 +606,12 @@ extern "C" void __hipRegisterFunction(
{
PlatformState::DeviceFunction func{ std::string{deviceName}, modules, std::vector<hipFunction_t>{g_devices.size()}};
PlatformState::instance().registerFunction(hostFunction, func);
// for (size_t i = 0; i < g_devices.size(); ++i) {
// PlatformState::instance().getFunc(hostFunction, i);
// }
if (!HIP_ENABLE_LAZY_KERNEL_LOADING) {
HIP_INIT();
for (size_t i = 0; i < g_devices.size(); ++i) {
PlatformState::instance().getFunc(hostFunction, i);
}
}
}
// Registers a device-side global variable.