SWDEV-326380 - Fixes a regression by verifying the device virtual address already exists in the memObjMap

Change-Id: Ibe29f3c6b77385a8e264ab523cafa4b5d2b41325


[ROCm/clr commit: 85a25a4be2]
Este commit está contenido en:
Sourabh Betigeri
2022-03-08 17:19:25 -08:00
cometido por Sourabh Betigeri
padre 650e69bbd3
commit 9a25ec266b
+4 -1
Ver fichero
@@ -994,7 +994,10 @@ hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags)
// Since the amd::Memory object is shared between all devices
// it's fine to have multiple addresses mapped to it
const device::Memory* devMem = mem->getDeviceMemory(*device->devices()[0]);
amd::MemObjMap::AddMemObj(reinterpret_cast<void*>(devMem->virtualAddress()), mem);
void* vAddr = reinterpret_cast<void*>(devMem->virtualAddress());
if (amd::MemObjMap::FindMemObj(vAddr) == nullptr) {
amd::MemObjMap::AddMemObj(vAddr, mem);
}
}
amd::MemObjMap::AddMemObj(hostPtr, mem);