Merge "Use the context variant of getNullStream" into amd-master-next
[ROCm/hip commit: 92b9a4466e]
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
مرجع در شماره جدید
Block a user