diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index 8e16200d41..1848b5bc4c 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -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(devMem->virtualAddress()), mem); }