Fix agent shutdown destructor errors (#969)
* Update lib/rocprofiler-sdk/agent.cpp
- use static_object wrapper for vector of agent_pair (rocp agent <-> hsa agent)
* Fix get_aql_handles() shutdown error
- use `static_object` wrapper for vector of `aqlprofile_agent_handle_t`
[ROCm/rocprofiler-sdk commit: 8b1b074b2a]
Bu işleme şunda yer alıyor:
işlemeyi yapan:
GitHub
ebeveyn
497668060a
işleme
df787c8a5a
@@ -644,7 +644,7 @@ auto&
|
||||
get_agent_caches()
|
||||
{
|
||||
static auto*& _v = common::static_object<std::vector<hsa::AgentCache>>::construct();
|
||||
return *_v;
|
||||
return *CHECK_NOTNULL(_v);
|
||||
}
|
||||
|
||||
struct agent_pair
|
||||
@@ -656,8 +656,8 @@ struct agent_pair
|
||||
auto&
|
||||
get_agent_mapping()
|
||||
{
|
||||
static auto _v = std::vector<agent_pair>{};
|
||||
return _v;
|
||||
static auto*& _v = common::static_object<std::vector<agent_pair>>::construct();
|
||||
return *CHECK_NOTNULL(_v);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -687,27 +687,28 @@ get_agent(rocprofiler_agent_id_t id)
|
||||
const std::vector<aqlprofile_agent_handle_t>&
|
||||
get_aql_handles()
|
||||
{
|
||||
static std::vector<aqlprofile_agent_handle_t> _v = []() {
|
||||
std::vector<aqlprofile_agent_handle_t> agent_handles;
|
||||
for(auto& agent : get_agents())
|
||||
{
|
||||
aqlprofile_agent_info_t agent_info = {
|
||||
.agent_gfxip = agent->name,
|
||||
.xcc_num = agent->num_xcc,
|
||||
.se_num = agent->num_shader_banks,
|
||||
.cu_num = agent->cu_count,
|
||||
.shader_arrays_per_se = agent->simd_arrays_per_engine};
|
||||
aqlprofile_agent_handle_t handle = {.handle = 0};
|
||||
if(aqlprofile_register_agent(&handle, &agent_info) != HSA_STATUS_SUCCESS)
|
||||
static auto*& _v =
|
||||
common::static_object<std::vector<aqlprofile_agent_handle_t>>::construct([]() {
|
||||
std::vector<aqlprofile_agent_handle_t> agent_handles;
|
||||
for(auto& agent : get_agents())
|
||||
{
|
||||
ROCP_WARNING << "Failed to register agent " << agent->name;
|
||||
aqlprofile_agent_info_t agent_info = {
|
||||
.agent_gfxip = agent->name,
|
||||
.xcc_num = agent->num_xcc,
|
||||
.se_num = agent->num_shader_banks,
|
||||
.cu_num = agent->cu_count,
|
||||
.shader_arrays_per_se = agent->simd_arrays_per_engine};
|
||||
aqlprofile_agent_handle_t handle = {.handle = 0};
|
||||
if(aqlprofile_register_agent(&handle, &agent_info) != HSA_STATUS_SUCCESS)
|
||||
{
|
||||
ROCP_WARNING << "Failed to register agent " << agent->name;
|
||||
}
|
||||
agent_handles.push_back(handle);
|
||||
}
|
||||
agent_handles.push_back(handle);
|
||||
}
|
||||
return agent_handles;
|
||||
}();
|
||||
return agent_handles;
|
||||
}());
|
||||
|
||||
return _v;
|
||||
return *CHECK_NOTNULL(_v);
|
||||
}
|
||||
|
||||
const aqlprofile_agent_handle_t*
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle