From 0d74d8b1877e46bb1e4f3a302ed8dfe6f6e74989 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Mon, 4 Dec 2023 18:37:10 +0000 Subject: [PATCH] SWDEV-430911 - Force SDMA only if explicitly specified & pick appropriate engine. Change-Id: Ib34fa6b2782f74b753899fa8fddff646dc60c8ce [ROCm/clr commit: 3daf8b334afa701bcc29aa3f4734903d183f2927] --- projects/clr/rocclr/device/rocm/rocblit.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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]);