diff --git a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 1fa48a94da..3134e87d11 100644 --- a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -643,15 +643,14 @@ hsa_status_t GpuAgent::DmaCopy(void* dst, core::Agent& dst_agent, return HSA_STATUS_ERROR_OUT_OF_RESOURCES; } - hsa_status_t stat = - blit->SubmitLinearCopyCommand(dst, src, size, dep_signals, out_signal); - - if (profiling_enabled() && HSA_STATUS_SUCCESS == stat) { + if (profiling_enabled()) { // Track the agent so we could translate the resulting timestamp to system // domain correctly. out_signal.async_copy_agent(this); } + hsa_status_t stat = blit->SubmitLinearCopyCommand(dst, src, size, dep_signals, out_signal); + return stat; }