[2/N] Agent Counter implementation with unit tests to check functionality (#846)

Agent Counter Collection API with tests and samples.
---------

Co-authored-by: Benjamin Welton <ben@amd.com>
Этот коммит содержится в:
Benjamin Welton
2024-05-21 13:34:54 -07:00
коммит произвёл GitHub
родитель 7eeb7376b4
Коммит 28e6430d04
32 изменённых файлов: 2097 добавлений и 157 удалений
+3 -3
Просмотреть файл
@@ -656,8 +656,8 @@ get_agent_topology()
auto&
get_agent_caches()
{
static auto _v = std::vector<hsa::AgentCache>{};
return _v;
static auto*& _v = common::static_object<std::vector<hsa::AgentCache>>::construct();
return *_v;
}
struct agent_pair
@@ -920,7 +920,7 @@ construct_agent_cache(::HsaApiTable* table)
try
{
get_agent_caches().emplace_back(
rocp_agent, hsa_agent, itr.first, _nearest_cpu, *table->amd_ext_);
rocp_agent, hsa_agent, itr.first, _nearest_cpu, *table->amd_ext_, *table->core_);
} catch(std::runtime_error& err)
{
if(rocp_agent->type == ROCPROFILER_AGENT_TYPE_GPU)