codekingpro/portable-devtools
114k
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <vector>
6
7namespace NV {
8 namespace Metric {
9 namespace Eval {
10 struct MetricNameValue
11 {
12 std::string metricName;
13 int numRanges;
14 // <rangeName , metricValue> pair
15 std::vector < std::pair<std::string, double> > rangeNameMetricValueMap;
16 };
17
18 /* Function to get aggregate metric values
19 * @param[in] chipName Chip name for which to get metric values
20 * @param[in] counterDataImage Counter data image
21 * @param[in] metricNames List of metrics to read from counter data image
22 * @param[out] metricNameValueMap Metric name value map
23 * @param[in] pCounterAvailabilityImage Pointer to counter availability image queried on target device
24 */
25 bool GetMetricGpuValue( std::string chipName,
26 const std::vector<uint8_t>& counterDataImage,
27 const std::vector<std::string>& metricNames,
28 std::vector<MetricNameValue>& metricNameValueMap,
29 const uint8_t* pCounterAvailabilityImage = NULL);
30
31 /* Function to print aggregate metric values
32 * @param[in] chipName Chip name for which to get metric values
33 * @param[in] counterDataImage Counter data image
34 * @param[in] metricNames List of metrics to read from counter data image
35 * @param[in] pCounterAvailabilityImage Pointer to counter availability image queried on target device
36 */
37 bool PrintMetricValues( std::string chipName,
38 const std::vector<uint8_t>& counterDataImage,
39 const std::vector<std::string>& metricNames,
40 const uint8_t* pCounterAvailabilityImage = NULL);
41 }
42 }
43}