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

Change-Id: I404f6d2bcd0c0e31b9b0237903f26f0af19bc735


[ROCm/clr commit: 545cfaf428]
Этот коммит содержится в:
Sourabh Betigeri
2022-03-01 16:29:23 -08:00
коммит произвёл Sourabh Betigeri
родитель f8cac285e5
Коммит eca06b35b9
+2 -2
Просмотреть файл
@@ -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);
}