diff --git a/projects/clr/rocclr/runtime/device/rocm/rocmemory.cpp b/projects/clr/rocclr/runtime/device/rocm/rocmemory.cpp index f99b19b740..a5f425cfc9 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocmemory.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocmemory.cpp @@ -121,10 +121,13 @@ void* Memory::allocMapTarget(const amd::Coord3D& origin, const amd::Coord3D& reg } void* mappedMemory = nullptr; + void* hostMem = owner()->getHostMem(); if (owner()->getSvmPtr() != nullptr) { owner()->commitSvmMemory(); mappedMemory = owner()->getSvmPtr(); + } else if (hostMem != nullptr) { // Otherwise, check for host memory. + return (reinterpret_cast
(hostMem) + origin[0]); } else { mappedMemory = reinterpret_cast(mapMemory_->getHostMem()) + origin[0]; }