SWDEV-242337-Fix hipHostRegister test failure for MGPU
Change-Id: I748dac0c5a47fa00184f065d9ef716573aa70b12
This commit is contained in:
@@ -725,9 +725,14 @@ hipError_t hipHostUnregister(void* hostPtr) {
|
||||
amd::Memory* mem = getMemoryObject(hostPtr, offset);
|
||||
|
||||
if(mem) {
|
||||
for (const auto& device: hip::getCurrentDevice()->devices()) {
|
||||
const device::Memory* devMem = mem->getDeviceMemory(*device);
|
||||
amd::MemObjMap::RemoveMemObj(reinterpret_cast<void*>(devMem->virtualAddress()));
|
||||
for (const auto& device: g_devices) {
|
||||
const device::Memory* devMem = mem->getDeviceMemory(*device->devices()[0]);
|
||||
if (devMem != nullptr) {
|
||||
void* vAddr = reinterpret_cast<void*>(devMem->virtualAddress());
|
||||
if (amd::MemObjMap::FindMemObj(vAddr)) {
|
||||
amd::MemObjMap::RemoveMemObj(vAddr);
|
||||
}
|
||||
}
|
||||
}
|
||||
amd::MemObjMap::RemoveMemObj(hostPtr);
|
||||
mem->release();
|
||||
|
||||
Reference in New Issue
Block a user