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 authored and Sourabh Betigeri committed 2022-03-02 20:26:28 -05:00
1 orang tua ab16be4b8f
melakukan 545cfaf428
1 file changed
+2 -2
+2 -2
Melihat File
@@ -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);
}