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

Этот коммит содержится в:
Saleel Kudchadker
2020-02-25 13:03:22 -05:00
коммит произвёл Gerrit Code Review
родитель 02835e5591 1ccaea7ca8
Коммит d5938efcce
2 изменённых файлов: 6 добавлений и 2 удалений
+1
Просмотреть файл
@@ -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
Просмотреть файл
@@ -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);