diff --git a/projects/clr/rocclr/device/rocm/rocblit.cpp b/projects/clr/rocclr/device/rocm/rocblit.cpp index 9ea2bf2b55..1da6fbcd3e 100644 --- a/projects/clr/rocclr/device/rocm/rocblit.cpp +++ b/projects/clr/rocclr/device/rocm/rocblit.cpp @@ -691,7 +691,7 @@ bool DmaBlitManager::hsaCopy(const Memory& srcMemory, const Memory& dstMemory, // Determine engine and assign a copy mask for the new versatile ROCr API // If engine preferred is SDMA, assign the SdmaWrite path if ((srcAgent.handle == dev().getCpuAgent().handle) && - (dstAgent.handle != dev().getCpuAgent().handle) || forceSDMA) { + (dstAgent.handle != dev().getCpuAgent().handle)) { engine = HwQueueEngine::SdmaWrite; copyMask = kUseRegularCopyApi ? 0 : dev().fetchSDMAMask(this, false); } else if ((srcAgent.handle != dev().getCpuAgent().handle) && @@ -700,6 +700,11 @@ bool DmaBlitManager::hsaCopy(const Memory& srcMemory, const Memory& dstMemory, copyMask = kUseRegularCopyApi ? 0 : dev().fetchSDMAMask(this, true); } + if (engine == HwQueueEngine::Unknown && forceSDMA) { + engine = HwQueueEngine::SdmaRead; + copyMask = kUseRegularCopyApi ? 0 : dev().fetchSDMAMask(this, true); + } + // Check if host wait has to be forced bool forceHostWait = forceHostWaitFunc(size[0]);