load program state once per agent

This commit is contained in:
Jeff Daily
2019-03-27 18:19:10 +00:00
szülő 93906a072c
commit 2845b4c4b8
4 fájl változott, egészen pontosan 102 új sor hozzáadva és 104 régi sor törölve
+3 -12
Fájl megtekintése
@@ -490,21 +490,12 @@ hipError_t hipFuncGetAttributes(hipFuncAttributes* attr, const void* func)
if (!attr) return hipErrorInvalidValue;
if (!func) return hipErrorInvalidDeviceFunction;
const auto it0 = functions().find(reinterpret_cast<uintptr_t>(func));
if (it0 == functions().cend()) return hipErrorInvalidDeviceFunction;
auto agent = this_agent();
const auto it1 = find_if(
it0->second.cbegin(),
it0->second.cend(),
[=](const pair<hsa_agent_t, Kernel_descriptor>& x) {
return x.first == agent;
});
const auto it = functions(agent).find(reinterpret_cast<uintptr_t>(func));
if (it1 == it0->second.cend()) return hipErrorInvalidDeviceFunction;
if (it == functions(agent).cend()) return hipErrorInvalidDeviceFunction;
const auto header = static_cast<hipFunction_t>(it1->second)->_header;
const auto header = static_cast<hipFunction_t>(it->second)->_header;
if (!header) throw runtime_error{"Ill-formed Kernel_descriptor."};