From 3fd1f5696eba73c1ad324ec33235cd5cf9a8ef8f Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Fri, 29 Apr 2022 16:20:10 -0500 Subject: [PATCH] Use block pointer info in async copy. Only block info can return an agent which is disabled in the process. Change-Id: I34cb1f9eea9217e10a484726c90d930e3414e769 [ROCm/ROCR-Runtime commit: 13a0cdfa7799babe3e7157d6cc7ce364c20ac3e9] --- .../runtime/hsa-runtime/core/runtime/runtime.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index 6f71458532..19d23404f8 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -477,14 +477,16 @@ hsa_status_t Runtime::CopyMemory(void* dst, core::Agent* dst_agent, const void* PtrInfo(ptr, &info, nullptr, nullptr, nullptr, &block); // Limit to IPC and GFX types for now. These are the only types for which the application may // not posess a proper agent handle. - if ((info.type != HSA_EXT_POINTER_TYPE_IPC) && (info.type != HSA_EXT_POINTER_TYPE_GRAPHICS)) - return; - agent = Agent::Convert(info.agentOwner); + if ((info.type != HSA_EXT_POINTER_TYPE_IPC) && (info.type != HSA_EXT_POINTER_TYPE_GRAPHICS)) { + return agent; + } + return block.agentOwner; } + return agent; }; - lookupAgent(dst_agent, dst); - lookupAgent(src_agent, src); + dst_agent = lookupAgent(dst_agent, dst); + src_agent = lookupAgent(src_agent, src); if (dst_agent == nullptr || src_agent == nullptr) return HSA_STATUS_ERROR_INVALID_AGENT; // At least one agent must be available for operation in the current process.