SWDEV-273026 - Fixes a bug that skipped looping through all devices to book keep its corresponding memory in roclr

Change-Id: I404f6d2bcd0c0e31b9b0237903f26f0af19bc735
This commit is contained in:
Sourabh Betigeri
2022-03-01 16:29:23 -08:00
zatwierdzone przez Sourabh Betigeri
rodzic ab16be4b8f
commit 545cfaf428
+2 -2
Wyświetl plik
@@ -990,10 +990,10 @@ hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags)
HIP_RETURN(hipErrorOutOfMemory);
}
for (const auto& device: hip::getCurrentDevice()->devices()) {
for (const auto& device : g_devices) {
// 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);
const device::Memory* devMem = mem->getDeviceMemory(*device->devices()[0]);
amd::MemObjMap::AddMemObj(reinterpret_cast<void*>(devMem->virtualAddress()), mem);
}