From a36856b02a177ccfcb6d354c7ac1c70afa1b03df Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 12 Oct 2023 15:03:49 -0400 Subject: [PATCH] Use user requested engine ID when forcing SDMA copies When forcing SDMA copies, engine ID specified by the requester should still be used since the requester has hint of engine availability. Change-Id: Idefa9494e407e31da510aa4c7c1fa283c85a4f6e --- runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 0965a21c32..f5d276f0be 100644 --- a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -1043,8 +1043,7 @@ hsa_status_t GpuAgent::DmaCopyOnEngine(void* dst, core::Agent& dst_agent, return HSA_STATUS_ERROR_INVALID_ARGUMENT; } - engine_offset = is_same_gpu ?(force_copy_on_sdma ? BlitDevToHost : - BlitDevToDev) : engine_offset; + engine_offset = is_same_gpu && !force_copy_on_sdma ? BlitDevToDev : engine_offset; } SetCopyRequestRefCount(true);