load functions when registered if lazy load is disabled

Change-Id: I6f10a72f7643e476407af03b04ef52e59741be45


[ROCm/clr commit: 0a9d550d9b]
This commit is contained in:
Payam
2020-05-14 00:18:32 -04:00
committad av Payam Ghafari
förälder 83f131638c
incheckning bfde2ce8f8
+6 -10
Visa fil
@@ -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.