Fixed host allocated globals address lookup for host usage

Fixed texture driver APIs failure


[ROCm/hip commit: 24ab820a11]
Этот коммит содержится в:
Rahul Garg
2018-01-30 18:06:31 +05:30
родитель fad10eed7d
Коммит e2ade308cf
4 изменённых файлов: 8 добавлений и 11 удалений
+4 -5
Просмотреть файл
@@ -169,7 +169,7 @@ namespace
lock_guard<mutex> lck{mtx};
if (globals().find(x) != globals().cend()) return;
globals().emplace(x, (void*)(it1->second.first));
void* p = nullptr;
hsa_amd_memory_lock(
reinterpret_cast<void*>(it1->second.first),
@@ -181,7 +181,6 @@ namespace
hsa_executable_agent_global_variable_define(
executable, agent, x.c_str(), p);
globals().emplace(x, RAII_global{p, hsa_amd_memory_unlock});
}
}
@@ -462,9 +461,9 @@ namespace hip_impl
return r;
}
unordered_map<string, RAII_global>& globals()
unordered_map<string, void*>& globals()
{
static unordered_map<string, RAII_global> r;
static unordered_map<string, void*> r;
static once_flag f;
call_once(f, []() { r.reserve(symbol_addresses().size()); });
@@ -491,4 +490,4 @@ namespace hip_impl
return executable;
}
} // Namespace hip_impl.
} // Namespace hip_impl.