SWDEV-326380 - Fixes a regression by verifying the device virtual address already exists in the memObjMap
Change-Id: Ibe29f3c6b77385a8e264ab523cafa4b5d2b41325
This commit is contained in:
committed by
Sourabh Betigeri
parent
104992ffda
commit
85a25a4be2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user