6 #ifndef LEVELZEROIOGROUP_HPP_INCLUDE
7 #define LEVELZEROIOGROUP_HPP_INCLUDE
21 class LevelZeroDevicePool;
31 std::shared_ptr<SaveControl> save_control_test);
39 int push_signal(
const std::string &signal_name,
int domain_type,
40 int domain_idx)
override;
41 int push_control(
const std::string &control_name,
int domain_type,
42 int domain_idx)
override;
45 double sample(
int batch_idx)
override;
46 void adjust(
int batch_idx,
double setting)
override;
47 double read_signal(
const std::string &signal_name,
int domain_type,
48 int domain_idx)
override;
49 void write_control(
const std::string &control_name,
int domain_type,
50 int domain_idx,
double setting)
override;
53 std::function<double(
const std::vector<double> &)>
agg_function(
54 const std::string &signal_name)
const override;
56 const std::string &signal_name)
const override;
58 &signal_name)
const override;
60 &control_name)
const override;
62 void save_control(
const std::string &save_path)
override;
64 std::string
name(
void)
const override;
70 void register_derivative_signals(
void);
71 void register_signal_alias(
const std::string &alias_name,
72 const std::string &signal_name);
73 void register_control_alias(
const std::string &alias_name,
74 const std::string &control_name);
82 std::string m_description;
84 std::function<double(
const std::vector<double> &)> m_agg_function;
86 std::function<std::string(
double)> m_format_function;
87 std::vector<std::shared_ptr<Signal> > m_signals;
88 std::function<double (
unsigned int)> m_devpool_func;
93 std::string m_description;
94 std::vector<std::shared_ptr<control_s> > m_controls;
96 std::function<double(
const std::vector<double> &)> m_agg_function;
97 std::function<std::string(
double)> m_format_function;
100 struct derivative_signal_info
102 std::string m_description;
103 std::string m_base_name;
104 std::string m_time_name;
105 std::function<double(
const std::vector<double> &)> m_agg_function;
107 double m_nan_replace;
110 static const std::string M_PLUGIN_NAME;
111 static const std::string M_NAME_PREFIX;
112 const PlatformTopo &m_platform_topo;
113 const LevelZeroDevicePool &m_levelzero_device_pool;
114 bool m_is_batch_read;
117 std::map<std::string, signal_info> m_signal_available;
118 std::map<std::string, control_info> m_control_available;
119 std::vector<std::shared_ptr<Signal> > m_signal_pushed;
120 std::vector<std::shared_ptr<control_s> > m_control_pushed;
121 const std::set<std::string> m_special_signal_set;
122 std::map<std::string, derivative_signal_info> m_derivative_signal_map;
123 std::set<int> m_derivative_signal_pushed_set;
126 std::vector<std::pair<double,double> > m_frequency_range;
127 std::vector<double> m_perf_factor;
129 std::shared_ptr<SaveControl> m_mock_save_ctl;
131 bool m_is_perf_factor_enabled;
Definition: IOGroup.hpp:21
Definition: LevelZeroDevicePool.hpp:19
IOGroup that provides signals and controls for GPUs.
Definition: LevelZeroIOGroup.hpp:26
std::function< double(const std::vector< double > &)> agg_function(const std::string &signal_name) const override
Return a function that should be used when aggregating the given signal.
Definition: LevelZeroIOGroup.cpp:1446
int signal_domain_type(const std::string &signal_name) const override
Query the domain for a named signal.
Definition: LevelZeroIOGroup.cpp:1019
static std::unique_ptr< IOGroup > make_plugin(void)
Definition: LevelZeroIOGroup.cpp:1516
int push_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Add a signal to the list of signals that is read by read_batch() and sampled by sample().
Definition: LevelZeroIOGroup.cpp:1041
std::function< std::string(double)> format_function(const std::string &signal_name) const override
Returns a function that can be used to convert a signal of the given name into a printable string....
Definition: LevelZeroIOGroup.cpp:1458
std::set< std::string > control_names(void) const override
Returns the names of all controls provided by the IOGroup.
Definition: LevelZeroIOGroup.cpp:997
double read_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Read from platform and interpret into SI units a signal given its name and domain....
Definition: LevelZeroIOGroup.cpp:1264
std::string name(void) const override
Get the IOGroup name.
Definition: LevelZeroIOGroup.cpp:1493
void read_batch(void) override
Read all pushed signals from the platform so that the next call to sample() will reflect the updated ...
Definition: LevelZeroIOGroup.cpp:1178
void restore_control(void) override
Restore all controls to values recorded in previous call to the save() method.
Definition: LevelZeroIOGroup.cpp:1401
static std::string plugin_name(void)
Definition: LevelZeroIOGroup.cpp:1499
std::set< std::string > signal_names(void) const override
Returns the names of all signals provided by the IOGroup.
Definition: LevelZeroIOGroup.cpp:987
int push_control(const std::string &control_name, int domain_type, int domain_idx) override
Add a control to the list of controls that is written by write_batch() and configured with adjust().
Definition: LevelZeroIOGroup.cpp:1133
std::string control_description(const std::string &control_name) const override
Returns a description of the control. This string can be used by tools to generate help text for user...
Definition: LevelZeroIOGroup.cpp:1482
LevelZeroIOGroup()
Definition: LevelZeroIOGroup.cpp:36
void write_control(const std::string &control_name, int domain_type, int domain_idx, double setting) override
Interpret the setting and write setting to the platform. Does not modify the values stored by calling...
Definition: LevelZeroIOGroup.cpp:1303
void write_batch(void) override
Write all of the pushed controls so that values previously given to adjust() are written to the platf...
Definition: LevelZeroIOGroup.cpp:1192
int control_domain_type(const std::string &control_name) const override
Query the domain for a named control.
Definition: LevelZeroIOGroup.cpp:1030
int signal_behavior(const std::string &signal_name) const override
Returns a hint about how a signal will change as a function of time.
Definition: LevelZeroIOGroup.cpp:1504
void adjust(int batch_idx, double setting) override
Adjust a setting for a particular control that was previously pushed with push_control()....
Definition: LevelZeroIOGroup.cpp:1249
double sample(int batch_idx) override
Retrieve signal value from data read by last call to read_batch() for a particular signal previously ...
Definition: LevelZeroIOGroup.cpp:1228
virtual ~LevelZeroIOGroup()=default
std::string signal_description(const std::string &signal_name) const override
Returns a description of the signal. This string can be used by tools to generate help text for users...
Definition: LevelZeroIOGroup.cpp:1470
bool is_valid_signal(const std::string &signal_name) const override
Test if signal_name refers to a signal supported by the group.
Definition: LevelZeroIOGroup.cpp:1007
void save_control(void) override
Save the state of all controls so that any subsequent changes made through the IOGroup can be undone ...
Definition: LevelZeroIOGroup.cpp:1358
bool is_valid_control(const std::string &control_name) const override
Test if control_name refers to a control supported by the group.
Definition: LevelZeroIOGroup.cpp:1013
const PlatformTopo & platform_topo(void)
Definition: PlatformTopo.cpp:81