Fixed host allocated globals address lookup for host usage

Fixed texture driver APIs failure
This commit is contained in:
Rahul Garg
2018-01-30 18:06:31 +05:30
förälder 84e3333c5b
incheckning 24ab820a11
4 ändrade filer med 8 tillägg och 11 borttagningar
+4 -5
Visa fil
@@ -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.