SWDEV-216213 - Use different static & dynamic module maps for faster lookup.

Change-Id: Ia605e76a411ad5be04046b9d61f1ac111d49bb4a


[ROCm/clr commit: 7356a74d35]
Tento commit je obsažen v:
kjayapra-amd
2020-03-30 11:32:27 -04:00
odevzdal Karthik Jayaprakash
rodič 8b0fec4333
revize bce2b56ea0
3 změnil soubory, kde provedl 51 přidání a 34 odebrání
+2 -14
Zobrazit soubor
@@ -160,27 +160,15 @@ inline bool ihipModuleRegisterFunc(amd::Program* program, hipModule_t* module) {
device::Program* dev_program
= program->getDeviceProgram(*hip::getCurrentDevice()->devices()[0]);
// Get all the global func names from COMGR
if (!dev_program->getGlobalFuncFromCodeObj(&func_names)) {
return false;
}
for (auto it = func_names.begin(); it != func_names.end(); ++it) {
auto modules = new std::vector<std::pair<hipModule_t, bool> >(g_devices.size());
for (size_t dev = 0; dev < g_devices.size(); ++dev) {
modules->at(dev) = std::make_pair(*module, true);
}
// Create a new pointer, since the hostFunction* wont be available
// if device code not in the same file as host code.
PlatformState::DeviceFunction dfunc{*it, modules, std::vector<hipFunction_t>{ g_devices.size() }, true};
PlatformState::instance().registerFunction(new std::string(it->c_str()), dfunc);
}
return true;
return PlatformState::instance().registerModFuncs(func_names, module);
}
inline bool ihipModuleRegisterGlobal(amd::Program* program, hipModule_t* module) {
size_t var_size = 0;