Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions src/runtime_src/core/common/smi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ to_ptree() const
}

smi_base::
smi_base()
{

examine_report_desc = {
smi_base() :
examine_report_desc {
{"host", "Host information", "common"}
};
}
},
configure_options {
{"device", "d", "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", "common", "", "string"},
{"help", "h", "Help to use this sub-command", "common", "", "none"}
}
{}

std::vector<basic_option>
smi_base::
Expand Down Expand Up @@ -131,22 +133,8 @@ construct_configure_subcommand() const
subcommand.put("type", "common");
subcommand.put("description", "Device and host configuration");

std::vector<option> options = {
{"device", "d", "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", "common", "", "string"},
{"help", "h", "Help to use this sub-command", "common", "", "none"},
{"daemon", "", "Update the device daemon configuration", "hidden", "", "none"},
{"purge", "", "Remove the daemon configuration file", "hidden", "", "string"},
{"host", "", "IP or hostname for device peer", "hidden", "", "string"},
{"security", "", "Update the security level for the device", "hidden", "", "string"},
{"clk_throttle", "", "Enable/disable the device clock throttling", "hidden", "", "string"},
{"ct_threshold_power_override", "", "Update the power threshold in watts", "hidden", "", "string"},
{"ct_threshold_temp_override", "", "Update the temperature threshold in celsius", "hidden", "", "string"},
{"ct_reset", "", "Reset all throttling options", "hidden", "", "string"},
{"showx", "", "Display the device configuration settings", "hidden", "", "string"}
};

ptree options_ptree;
for (const auto& option : options) {
for (const auto& option : configure_options) {
options_ptree.push_back(std::make_pair("", option.to_ptree()));
}

Expand Down
1 change: 1 addition & 0 deletions src/runtime_src/core/common/smi.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class smi_base {

tuple_vector validate_test_desc;
tuple_vector examine_report_desc;
std::vector<option> configure_options;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'configure_options' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

  std::vector<option> configure_options;
                      ^


std::vector<basic_option>
construct_option_description(const tuple_vector&) const;
Expand Down
14 changes: 14 additions & 0 deletions src/runtime_src/core/edge/user/smi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ smi_edge() : smi_base()
{"qspi-status", "QSPI write protection status", "common"},
{"thermal", "Thermal sensors present on the device", "common"}
};

configure_options = {
{"device", "d", "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", "common", "", "string"},
{"help", "h", "Help to use this sub-command", "common", "", "none"},
{"daemon", "", "Update the device daemon configuration", "hidden", "", "none"},
{"purge", "", "Remove the daemon configuration file", "hidden", "", "string"},
{"host", "", "IP or hostname for device peer", "hidden", "", "string"},
{"security", "", "Update the security level for the device", "hidden", "", "string"},
{"clk_throttle", "", "Enable/disable the device clock throttling", "hidden", "", "string"},
{"ct_threshold_power_override", "", "Update the power threshold in watts", "hidden", "", "string"},
{"ct_threshold_temp_override", "", "Update the temperature threshold in celsius", "hidden", "", "string"},
{"ct_reset", "", "Reset all throttling options", "hidden", "", "string"},
{"showx", "", "Display the device configuration settings", "hidden", "", "string"}
};
}

// Create an instance of the derived class
Expand Down
14 changes: 14 additions & 0 deletions src/runtime_src/core/pcie/linux/smi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ smi_pcie() : smi_base()
{"qspi-status", "QSPI write protection status", "common"},
{"thermal", "Thermal sensors present on the device", "common"}
};

configure_options = {
{"device", "d", "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", "common", "", "string"},
{"help", "h", "Help to use this sub-command", "common", "", "none"},
{"daemon", "", "Update the device daemon configuration", "hidden", "", "none"},
{"purge", "", "Remove the daemon configuration file", "hidden", "", "string"},
{"host", "", "IP or hostname for device peer", "hidden", "", "string"},
{"security", "", "Update the security level for the device", "hidden", "", "string"},
{"clk_throttle", "", "Enable/disable the device clock throttling", "hidden", "", "string"},
{"ct_threshold_power_override", "", "Update the power threshold in watts", "hidden", "", "string"},
{"ct_threshold_temp_override", "", "Update the temperature threshold in celsius", "hidden", "", "string"},
{"ct_reset", "", "Reset all throttling options", "hidden", "", "string"},
{"showx", "", "Display the device configuration settings", "hidden", "", "string"}
};
}

// Create an instance of the derived class
Expand Down