Merge "Use the context variant of getNullStream" into amd-master-next

Tento commit je obsažen v:
Saleel Kudchadker
2020-02-25 13:03:22 -05:00
odevzdal Gerrit Code Review
2 změnil soubory, kde provedl 6 přidání a 2 odebrání
+1
Zobrazit soubor
@@ -103,6 +103,7 @@ amd::HostQueue* getNullStream(Device& dev) {
}
return stream->second;
}
amd::HostQueue* getNullStream(amd::Context& ctx) {
for (auto& it : g_nullStreams) {
if (it.first->asContext() == &ctx) {
+5 -2
Zobrazit soubor
@@ -224,8 +224,11 @@ hipError_t hipFree(void* ptr) {
}
if (amd::SvmBuffer::malloced(ptr)) {
hip::syncStreams();
for (size_t i=0; i<g_devices.size(); ++i) {
hip::getNullStream(*g_devices[i])->finish();
for (auto& dev : g_devices) {
amd::HostQueue* queue = hip::getNullStream(*dev->asContext());
if (queue != nullptr) {
queue->finish();
}
}
amd::SvmBuffer::free(*hip::getCurrentDevice()->asContext(), ptr);
HIP_RETURN(hipSuccess);