Add support for reading frequency-volt curve data

Bu işleme şunda yer alıyor:
Chris Freehill
2019-01-07 08:44:23 -06:00
ebeveyn 253c82c93a
işleme b6ce6d30f4
3 değiştirilmiş dosya ile 40 ekleme ve 20 silme
+17 -3
Dosyayı Görüntüle
@@ -147,7 +147,7 @@ static uint64_t freq_string_to_int(const std::vector<std::string> &freq_lines,
std::istringstream fs(freq_lines[i]);
uint32_t ind;
uint64_t freq;
long double freq;
std::string junk;
std::string units_str;
std::string star_str;
@@ -183,8 +183,8 @@ static void freq_volt_string_to_point(std::string in_line,
assert(pt != nullptr);
uint32_t ind;
float freq;
float volts;
long double freq;
long double volts;
std::string junk;
std::string freq_units_str;
std::string volts_units_str;
@@ -633,6 +633,8 @@ static const uint32_t kOD_OD_RANGE_label_array_index =
kOD_VDDC_CURVE_label_array_index + 4;
static const uint32_t kOD_VDDC_CURVE_start_index =
kOD_OD_RANGE_label_array_index + 3;
static const uint32_t kOD_VDDC_CURVE_num_lines =
kOD_VDDC_CURVE_start_index + 4;
static rsmi_status_t get_od_clk_volt_info(uint32_t dv_ind,
rsmi_od_volt_freq_data *p) {
@@ -647,6 +649,12 @@ static rsmi_status_t get_od_clk_volt_info(uint32_t dv_ind,
return ret;
}
// This is a work-around to handle systems where kDevPowerODVoltage is not
// fully supported yet.
if (val_vec.size() < 2) {
return RSMI_STATUS_NOT_YET_IMPLEMENTED;
}
assert(val_vec[kOD_SCLK_label_array_index] == "OD_SCLK:");
p->curr_sclk_range.lower_bound = freq_string_to_int(val_vec, nullptr,
@@ -723,6 +731,12 @@ static rsmi_status_t get_od_clk_volt_curve_regions(uint32_t dv_ind,
return ret;
}
// This is a work-around to handle systems where kDevPowerODVoltage is not
// fully supported yet.
if (val_vec.size() < 2) {
return RSMI_STATUS_NOT_YET_IMPLEMENTED;
}
uint32_t val_vec_size = val_vec.size();
assert((val_vec_size - kOD_VDDC_CURVE_start_index) > 0);
assert((val_vec_size - kOD_VDDC_CURVE_start_index)%2 == 0);
+3
Dosyayı Görüntüle
@@ -250,6 +250,9 @@ int Device::readDevInfoMultiLineStr(DevInfoTypes type,
retVec->push_back(line);
}
if (retVec->size() == 0) {
return EPERM;
}
// Remove any *trailing* empty (whitespace) lines
while (retVec->back().find_first_not_of(" \t\n\v\f\r") == std::string::npos) {
retVec->pop_back();