Agent Implementation (#78)

* Agent Implementation

* Remove unused Findrocprofiler

* Update lib/rocprofiler/hsa/agent.{hpp,cpp}

- default AgentInfo ctor
- getNumaNode() const
- noexcept move ctors
- default initializers for member variables
- fixed clang-tidy recommentations
  - preallocate
  - static in anon namespace
- AgentInfo::setName uses strncpy and ensures that it is terminated

* Update lib/rocprofiler/rocprofiler.cpp (agent.cpp and pc_sampling.cpp)

- move public PC sampling function implementations to pc_sampling.cpp
- move public agent function implementation to agent.cpp
Este commit está contenido en:
Jonathan R. Madsen authored and GitHub committed 2023-09-22 11:51:21 -07:00
1 padre 5c07deb159
commit 6fb9000fa1
13 files changed
+858 -173

No files matched your search

+2 -1
Ver fichero
@@ -29,6 +29,7 @@ target_link_libraries(
$<BUILD_INTERFACE:rocprofiler::rocprofiler-hip>
$<BUILD_INTERFACE:rocprofiler::rocprofiler-amd-comgr>
$<BUILD_INTERFACE:rocprofiler::rocprofiler-hsa-runtime>
$<BUILD_INTERFACE:rocprofiler::rocprofiler-ptl>)
$<BUILD_INTERFACE:rocprofiler::rocprofiler-ptl>
$<BUILD_INTERFACE:rocprofiler::rocprofiler-hsa-aql>)
set_target_properties(rocprofiler-common-library PROPERTIES OUTPUT_NAME
rocprofiler-common)
+16
Ver fichero
@@ -45,5 +45,21 @@ timestamp_ns()
// TODO(jrmadsen): this should be updated to the HSA method
return std::chrono::steady_clock::now().time_since_epoch().count();
}
template <class Container, typename Key = typename Container::key_type>
const auto*
get_val(const Container& map, const Key& key)
{
auto pos = map.find(key);
return (pos != map.end() ? &pos->second : nullptr);
}
template <class Container, typename Key = typename Container::key_type>
auto*
get_val(Container& map, const Key& key)
{
auto pos = map.find(key);
return (pos != map.end() ? &pos->second : nullptr);
}
} // namespace common
} // namespace rocprofiler