Bulk fetch metrics from rocm_smi_lib
The RDC provides a wrapper to bulk fetch metrics from rocm_smi_lib. If the video card does not support bulk fetch or the metrics cannot be bulk fetched, it will fallback to fetch them one by one. Change-Id: I8852ba1ed67e0fabc805c93b1080f74c233516e1
This commit is contained in:
committed by
Shuzhou Liu
parent
ceb562d630
commit
51efe26442
@@ -23,7 +23,9 @@ THE SOFTWARE.
|
||||
#define INCLUDE_RDC_LIB_RDCMETRICFETCHER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "rdc_lib/rdc_common.h"
|
||||
#include "rdc_lib/RdcTelemetryLibInterface.h"
|
||||
#include "rdc/rdc.h"
|
||||
|
||||
|
||||
@@ -37,6 +39,10 @@ class RdcMetricFetcher {
|
||||
|
||||
virtual rdc_status_t fetch_smi_field(uint32_t gpu_index,
|
||||
rdc_field_t field_id, rdc_field_value* value) = 0;
|
||||
|
||||
virtual rdc_status_t bulk_fetch_smi_fields(
|
||||
rdc_gpu_field_t* fields, uint32_t fields_count,
|
||||
std::vector<rdc_gpu_field_value_t>& results) = 0; // NOLINT
|
||||
virtual ~RdcMetricFetcher() {}
|
||||
};
|
||||
|
||||
|
||||
@@ -70,6 +70,9 @@ class RdcMetricFetcherImpl: public RdcMetricFetcher {
|
||||
public:
|
||||
rdc_status_t fetch_smi_field(uint32_t gpu_index,
|
||||
rdc_field_t field_id, rdc_field_value* value) override;
|
||||
rdc_status_t bulk_fetch_smi_fields(
|
||||
rdc_gpu_field_t* fields, uint32_t fields_count,
|
||||
std::vector<rdc_gpu_field_value_t>& results) override; // NOLINT
|
||||
RdcMetricFetcherImpl();
|
||||
~RdcMetricFetcherImpl();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user