SWDEV-476852 - Check added for agent architecture counters support. (#1022)

* check added for agent arch support

* formatting issue

[ROCm/rocprofiler-sdk commit: bc82eccf4f]
Este commit está contenido en:
venkat1361
2024-09-13 13:28:00 -05:00
cometido por GitHub
padre 5db64b5425
commit b9d2b3f495
Se han modificado 3 ficheros con 6 adiciones y 1 borrados
@@ -105,7 +105,8 @@ typedef enum // NOLINT(performance-enum-size)
ROCPROFILER_STATUS_ERROR_NOT_AVAILABLE, ///< The service is not available. ROCPROFILER_STATUS_ERROR_NOT_AVAILABLE, ///< The service is not available.
///< Please refer to API functions that return this ///< Please refer to API functions that return this
///< status code for more information. ///< status code for more information.
ROCPROFILER_STATUS_ERROR_EXCEEDS_HW_LIMIT, ///< Exceeds hardware limits for collection ROCPROFILER_STATUS_ERROR_EXCEEDS_HW_LIMIT, ///< Exceeds hardware limits for collection.
ROCPROFILER_STATUS_ERROR_AGENT_ARCH_NOT_SUPPORTED, ///< Agent HW architecture not supported.
ROCPROFILER_STATUS_LAST, ROCPROFILER_STATUS_LAST,
} rocprofiler_status_t; } rocprofiler_status_t;
@@ -125,6 +125,8 @@ rocprofiler_iterate_agent_supported_counters(rocprofiler_agent_id_t
if(!agent) return ROCPROFILER_STATUS_ERROR_AGENT_NOT_FOUND; if(!agent) return ROCPROFILER_STATUS_ERROR_AGENT_NOT_FOUND;
auto metrics = rocprofiler::counters::getMetricsForAgent(agent->name); auto metrics = rocprofiler::counters::getMetricsForAgent(agent->name);
if(metrics.empty()) return ROCPROFILER_STATUS_ERROR_AGENT_ARCH_NOT_SUPPORTED;
std::vector<rocprofiler_counter_id_t> ids; std::vector<rocprofiler_counter_id_t> ids;
ids.reserve(metrics.size()); ids.reserve(metrics.size());
for(const auto& metric : metrics) for(const auto& metric : metrics)
@@ -112,6 +112,8 @@ ROCPROFILER_STATUS_STRING(ROCPROFILER_STATUS_ERROR_NOT_AVAILABLE,
"this status code for more information.") "this status code for more information.")
ROCPROFILER_STATUS_STRING(ROCPROFILER_STATUS_ERROR_EXCEEDS_HW_LIMIT, ROCPROFILER_STATUS_STRING(ROCPROFILER_STATUS_ERROR_EXCEEDS_HW_LIMIT,
"Request exceeds the capabilities of the hardware to collect") "Request exceeds the capabilities of the hardware to collect")
ROCPROFILER_STATUS_STRING(ROCPROFILER_STATUS_ERROR_AGENT_ARCH_NOT_SUPPORTED,
"Agent HW architecture is not supported, no counter metrics found.")
template <size_t Idx, size_t... Tail> template <size_t Idx, size_t... Tail>
const char* const char*