From ae1da390bd956865c349d62d9dd89d587e95e892 Mon Sep 17 00:00:00 2001 From: Youssef Aly Date: Tue, 7 Nov 2023 12:56:53 -0600 Subject: [PATCH] Enabled profiling for CPU agents for memcpy activities To be able to trace memcpy asynchronously, both dst and src agents need to have profiling enabled and the api for enabling profiling was only enabling for gpu agents. CPU agents didn't have profiling enabled so the signal owner could not be known. hsa_amd_profiling_get_async_copy_time will fail with an HSA status error because it can't read the agent for the given signal. Change-Id: Ie165e0e39b8fcd6992a55695b9ffcead10a8e812 --- runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp b/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp index 34180f8908..5d8887116f 100644 --- a/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp +++ b/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp @@ -414,6 +414,11 @@ hsa_status_t hsa_amd_profiling_async_copy_enable(bool enable) { hsa_status_t err = agent->profiling_enabled(enable); if (err != HSA_STATUS_SUCCESS) ret = err; } + + for (core::Agent* agent : core::Runtime::runtime_singleton_->cpu_agents()) { + hsa_status_t err = agent->profiling_enabled(enable); + if (err != HSA_STATUS_SUCCESS) ret = err; + } return ret; CATCH;