diff --git a/projects/clr/rocclr/runtime/device/pal/palblit.cpp b/projects/clr/rocclr/runtime/device/pal/palblit.cpp index 40030668df..c32a6aa687 100644 --- a/projects/clr/rocclr/runtime/device/pal/palblit.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palblit.cpp @@ -298,7 +298,9 @@ bool DmaBlitManager::writeBuffer(const void* srcHost, device::Memory& dstMemory, const amd::Coord3D& origin, const amd::Coord3D& size, bool entire) const { // Use host copy if memory has direct access or it's persistent - if (setup_.disableWriteBuffer_ || gpuMem(dstMemory).isHostMemDirectAccess() || + if (setup_.disableWriteBuffer_ || + (gpuMem(dstMemory).isHostMemDirectAccess() && + (gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical)) || gpuMem(dstMemory).isPersistentDirectMap()) { return HostBlitManager::writeBuffer(srcHost, dstMemory, origin, size, entire); } else { @@ -384,7 +386,9 @@ bool DmaBlitManager::writeBufferRect(const void* srcHost, device::Memory& dstMem const amd::BufferRect& bufRect, const amd::Coord3D& size, bool entire) const { // Use host copy if memory has direct access or it's persistent - if (setup_.disableWriteBufferRect_ || dstMemory.isHostMemDirectAccess() || + if (setup_.disableWriteBufferRect_ || + (dstMemory.isHostMemDirectAccess() && + (gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical)) || gpuMem(dstMemory).isPersistentDirectMap()) { return HostBlitManager::writeBufferRect(srcHost, dstMemory, hostRect, bufRect, size, entire); } else { @@ -1926,7 +1930,9 @@ bool KernelBlitManager::writeBuffer(const void* srcHost, device::Memory& dstMemo bool result = false; // Use host copy if memory has direct access or it's persistent - if (setup_.disableWriteBuffer_ || gpuMem(dstMemory).isHostMemDirectAccess() || + if (setup_.disableWriteBuffer_ || + (gpuMem(dstMemory).isHostMemDirectAccess() && + (gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical)) || (gpuMem(dstMemory).memoryType() == Resource::Persistent)) { result = HostBlitManager::writeBuffer(srcHost, dstMemory, origin, size, entire); synchronize(); @@ -1975,7 +1981,9 @@ bool KernelBlitManager::writeBufferRect(const void* srcHost, device::Memory& dst bool result = false; // Use host copy if memory has direct access or it's persistent - if (setup_.disableWriteBufferRect_ || gpuMem(dstMemory).isHostMemDirectAccess() || + if (setup_.disableWriteBufferRect_ || + (gpuMem(dstMemory).isHostMemDirectAccess() && + (gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical)) || gpuMem(dstMemory).isPersistentDirectMap()) { result = HostBlitManager::writeBufferRect(srcHost, dstMemory, hostRect, bufRect, size, entire); synchronize(); diff --git a/projects/clr/rocclr/runtime/device/pal/palmemory.cpp b/projects/clr/rocclr/runtime/device/pal/palmemory.cpp index 4777390de9..b498d5c9e3 100644 --- a/projects/clr/rocclr/runtime/device/pal/palmemory.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palmemory.cpp @@ -127,6 +127,7 @@ bool Memory::create(Resource::MemoryType memType, Resource::CreateParams* params if (result) { switch (memoryType()) { case Resource::Pinned: + case Resource::ExternalPhysical: // Marks memory object for direct GPU access to the host memory flags_ |= HostMemoryDirectAccess; break; diff --git a/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp b/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp index dbfa84e012..bce0b937b9 100644 --- a/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp @@ -2570,7 +2570,11 @@ void VirtualGPU::submitSignal(amd::SignalCommand& vcmd) { queues_[engineID_]->addCmdMemRef(pGpuMemory->memRef()); queues_[engineID_]->iCmd()-> +#if (PAL_CLIENT_INTERFACE_MAJOR_VERSION < 396) CmdUpdateBusAddressableMemoryMarker(*(pGpuMemory->iMem()), value); +#else + CmdUpdateBusAddressableMemoryMarker(*(pGpuMemory->iMem()), vcmd.markerOffset(), value); +#endif eventEnd(engineID_, gpuEvent); // Restore the original engine