Make amdsmi function name consistent

Some of the amdsmi function have the verb (set or get) at the
end of the function. Move it to the middle to be consistent with
other APIs.

Change-Id: I8053d16f46af951c25aaaf8febf2896a33633fa1
Tento commit je obsažen v:
Bill(Shuzhou) Liu
2022-12-15 08:17:34 -06:00
rodič a80bbd308c
revize 221d6fdc5c
42 změnil soubory, kde provedl 1261 přidání a 1261 odebrání
+13 -13
Zobrazit soubor
@@ -106,23 +106,23 @@ void TestAPISupportRead::Run(void) {
std::cout << "Supported AMDSMI Functions:" << std::endl;
std::cout << "\tVariants (Monitors)" << std::endl;
}
err = amdsmi_dev_supported_func_iterator_open(device_handles_[i], &iter_handle);
err = amdsmi_dev_open_supported_func_iterator(device_handles_[i], &iter_handle);
CHK_ERR_ASRT(err)
while (1) {
err = amdsmi_func_iter_value_get(iter_handle, &value);
err = amdsmi_get_func_iter_value(iter_handle, &value);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "Function Name: " << value.name << std::endl;
}
err = amdsmi_dev_supported_variant_iterator_open(iter_handle, &var_iter);
err = amdsmi_dev_open_supported_variant_iterator(iter_handle, &var_iter);
if (err != AMDSMI_STATUS_NO_DATA) {
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\tVariants/Monitors: ";
}
while (1) {
err = amdsmi_func_iter_value_get(var_iter, &value);
err = amdsmi_get_func_iter_value(var_iter, &value);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
if (value.id == AMDSMI_DEFAULT_VARIANT) {
@@ -133,31 +133,31 @@ void TestAPISupportRead::Run(void) {
std::cout << " (";
}
err =
amdsmi_dev_supported_variant_iterator_open(var_iter, &sub_var_iter);
amdsmi_dev_open_supported_variant_iterator(var_iter, &sub_var_iter);
if (err != AMDSMI_STATUS_NO_DATA) {
CHK_ERR_ASRT(err)
while (1) {
err = amdsmi_func_iter_value_get(sub_var_iter, &value);
err = amdsmi_get_func_iter_value(sub_var_iter, &value);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << value.id << ", ";
}
err = amdsmi_func_iter_next(sub_var_iter);
err = amdsmi_next_func_iter(sub_var_iter);
if (err == AMDSMI_STATUS_NO_DATA) {
break;
}
CHK_ERR_ASRT(err)
}
err = amdsmi_dev_supported_func_iterator_close(&sub_var_iter);
err = amdsmi_dev_close_supported_func_iterator(&sub_var_iter);
CHK_ERR_ASRT(err)
}
IF_VERB(STANDARD) {
std::cout << "), ";
}
err = amdsmi_func_iter_next(var_iter);
err = amdsmi_next_func_iter(var_iter);
if (err == AMDSMI_STATUS_NO_DATA) {
break;
@@ -167,21 +167,21 @@ void TestAPISupportRead::Run(void) {
IF_VERB(STANDARD) {
std::cout << std::endl;
}
err = amdsmi_dev_supported_func_iterator_close(&var_iter);
err = amdsmi_dev_close_supported_func_iterator(&var_iter);
CHK_ERR_ASRT(err)
}
err = amdsmi_func_iter_next(iter_handle);
err = amdsmi_next_func_iter(iter_handle);
if (err == AMDSMI_STATUS_NO_DATA) {
break;
}
CHK_ERR_ASRT(err)
// err = amdsmi_dev_supported_variant_iterator_open(iter_handle, &var_iter);
// err = amdsmi_dev_open_supported_variant_iterator(iter_handle, &var_iter);
//
}
err = amdsmi_dev_supported_func_iterator_close(&iter_handle);
err = amdsmi_dev_close_supported_func_iterator(&iter_handle);
CHK_ERR_ASRT(err)
}
}
+8 -8
Zobrazit soubor
@@ -100,7 +100,7 @@ void TestErrCntRead::Run(void) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
PrintDeviceHeader(device_handles_[i]);
err = amdsmi_dev_ecc_enabled_get(device_handles_[i], &enabled_mask);
err = amdsmi_dev_get_ecc_enabled(device_handles_[i], &enabled_mask);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout <<
@@ -108,7 +108,7 @@ void TestErrCntRead::Run(void) {
<< std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_ecc_enabled_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_ecc_enabled(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
continue;
@@ -116,7 +116,7 @@ void TestErrCntRead::Run(void) {
CHK_ERR_ASRT(err)
// Verify api support checking functionality is working
err = amdsmi_dev_ecc_enabled_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_ecc_enabled(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
IF_VERB(STANDARD) {
@@ -126,7 +126,7 @@ void TestErrCntRead::Run(void) {
}
for (uint32_t b = AMDSMI_GPU_BLOCK_FIRST;
b <= AMDSMI_GPU_BLOCK_LAST; b = b*2) {
err = amdsmi_dev_ecc_status_get(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
err = amdsmi_dev_get_ecc_status(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
&err_state);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
@@ -135,11 +135,11 @@ void TestErrCntRead::Run(void) {
" block: " << GetErrStateNameStr(err_state) << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_ecc_status_get(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
err = amdsmi_dev_get_ecc_status(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
err = amdsmi_dev_ecc_count_get(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b), &ec);
err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b), &ec);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
@@ -148,7 +148,7 @@ void TestErrCntRead::Run(void) {
": Not supported for this device" << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_ecc_count_get(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
@@ -164,7 +164,7 @@ void TestErrCntRead::Run(void) {
<< std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_ecc_count_get(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
+7 -7
Zobrazit soubor
@@ -109,7 +109,7 @@ void TestEvtNotifReadWrite::Run(void) {
}
for (dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
ret = amdsmi_event_notification_init(device_handles_[dv_ind]);
ret = amdsmi_init_event_notification(device_handles_[dv_ind]);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout <<
@@ -119,7 +119,7 @@ void TestEvtNotifReadWrite::Run(void) {
return;
}
ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS);
ret = amdsmi_event_notification_mask_set(device_handles_[dv_ind], mask);
ret = amdsmi_set_event_notification_mask(device_handles_[dv_ind], mask);
ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS);
}
@@ -127,7 +127,7 @@ void TestEvtNotifReadWrite::Run(void) {
uint32_t num_elem = 10;
bool read_again = false;
ret = amdsmi_event_notification_get(10000, &num_elem, data);
ret = amdsmi_get_event_notification(10000, &num_elem, data);
if (ret == AMDSMI_STATUS_SUCCESS || ret == AMDSMI_STATUS_INSUFFICIENT_SIZE) {
EXPECT_LE(num_elem, 10) <<
"Expected the number of elements found to be <= buffer size (10)";
@@ -155,13 +155,13 @@ void TestEvtNotifReadWrite::Run(void) {
} else {
// This should always fail. We want to print out the return code.
EXPECT_EQ(ret, AMDSMI_STATUS_SUCCESS) <<
"Unexpected return code for amdsmi_event_notification_get()";
"Unexpected return code for amdsmi_get_event_notification()";
}
// In case GPU Pre reset event was collected in the previous read,
// read again to get the GPU Post reset event.
if (read_again) {
ret = amdsmi_event_notification_get(10000, &num_elem, data);
ret = amdsmi_get_event_notification(10000, &num_elem, data);
if (ret == AMDSMI_STATUS_SUCCESS || ret == AMDSMI_STATUS_INSUFFICIENT_SIZE) {
EXPECT_LE(num_elem, 10) <<
"Expected the number of elements found to be <= buffer size (10)";
@@ -186,12 +186,12 @@ void TestEvtNotifReadWrite::Run(void) {
} else {
// This should always fail. We want to print out the return code.
EXPECT_EQ(ret, AMDSMI_STATUS_SUCCESS) <<
"Unexpected return code for amdsmi_event_notification_get()";
"Unexpected return code for amdsmi_get_event_notification()";
}
}
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
ret = amdsmi_event_notification_stop(device_handles_[dv_ind]);
ret = amdsmi_stop_event_notification(device_handles_[dv_ind]);
ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS);
}
}
+6 -6
Zobrazit soubor
@@ -101,7 +101,7 @@ void TestFanRead::Run(void) {
IF_VERB(STANDARD) {
std::cout << "\t**Current Fan Speed: ";
}
err = amdsmi_dev_fan_speed_get(device_handles_[i], 0, &val_i64);
err = amdsmi_dev_get_fan_speed(device_handles_[i], 0, &val_i64);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout << "\t**" << ": " <<
@@ -114,30 +114,30 @@ void TestFanRead::Run(void) {
// Verify api support checking functionality is working
err = amdsmi_dev_fan_speed_get(device_handles_[i], 0, nullptr);
err = amdsmi_dev_get_fan_speed(device_handles_[i], 0, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
err = amdsmi_dev_fan_speed_max_get(device_handles_[i], 0, &val_ui64);
err = amdsmi_dev_get_fan_speed_max(device_handles_[i], 0, &val_ui64);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << val_i64/static_cast<float>(val_ui64)*100;
std::cout << "% ("<< val_i64 << "/" << val_ui64 << ")" << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_fan_speed_max_get(device_handles_[i], 0, nullptr);
err = amdsmi_dev_get_fan_speed_max(device_handles_[i], 0, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
IF_VERB(STANDARD) {
std::cout << "\t**Current fan RPMs: ";
}
err = amdsmi_dev_fan_rpms_get(device_handles_[i], 0, &val_i64);
err = amdsmi_dev_get_fan_rpms(device_handles_[i], 0, &val_i64);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << val_i64 << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_fan_rpms_get(device_handles_[i], 0, nullptr);
err = amdsmi_dev_get_fan_rpms(device_handles_[i], 0, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
+6 -6
Zobrazit soubor
@@ -100,7 +100,7 @@ void TestFanReadWrite::Run(void) {
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
PrintDeviceHeader(device_handles_[dv_ind]);
ret = amdsmi_dev_fan_speed_get(device_handles_[dv_ind], 0, &orig_speed);
ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &orig_speed);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout << "\t**" << ": " <<
@@ -120,7 +120,7 @@ void TestFanReadWrite::Run(void) {
return;
}
ret = amdsmi_dev_fan_speed_max_get(device_handles_[dv_ind], 0, &max_speed);
ret = amdsmi_dev_get_fan_speed_max(device_handles_[dv_ind], 0, &max_speed);
CHK_ERR_ASRT(ret)
new_speed = 1.1 * orig_speed;
@@ -136,12 +136,12 @@ void TestFanReadWrite::Run(void) {
std::cout << "Setting fan speed to " << new_speed << std::endl;
}
ret = amdsmi_dev_fan_speed_set(device_handles_[dv_ind], 0, new_speed);
ret = amdsmi_dev_set_fan_speed(device_handles_[dv_ind], 0, new_speed);
CHK_ERR_ASRT(ret)
sleep(4);
ret = amdsmi_dev_fan_speed_get(device_handles_[dv_ind], 0, &cur_speed);
ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &cur_speed);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
@@ -163,12 +163,12 @@ void TestFanReadWrite::Run(void) {
std::cout << "Resetting fan control to auto..." << std::endl;
}
ret = amdsmi_dev_fan_reset(device_handles_[dv_ind], 0);
ret = amdsmi_dev_reset_fan(device_handles_[dv_ind], 0);
CHK_ERR_ASRT(ret)
sleep(3);
ret = amdsmi_dev_fan_speed_get(device_handles_[dv_ind], 0, &cur_speed);
ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &cur_speed);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
+6 -6
Zobrazit soubor
@@ -116,12 +116,12 @@ void TestFrequenciesRead::Run(void) {
for (uint32_t x = 0; x < num_iterations(); ++x) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
auto freq_output = [&](amdsmi_clk_type_t t, const char *name) {
err = amdsmi_dev_gpu_clk_freq_get(device_handles_[i], t, &f);
err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, &f);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Get " << name <<
": Not supported on this machine" << std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_gpu_clk_freq_get(device_handles_[i], t, nullptr);
err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
} else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) {
std::cout << "\t**Get " << name <<
@@ -133,7 +133,7 @@ void TestFrequenciesRead::Run(void) {
std::cout << f.num_supported << std::endl;
print_frequencies(&f);
// Verify api support checking functionality is working
err = amdsmi_dev_gpu_clk_freq_get(device_handles_[i], t, nullptr);
err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
@@ -147,12 +147,12 @@ void TestFrequenciesRead::Run(void) {
freq_output(CLK_TYPE_DCEF, "Display Controller Engine Clock");
freq_output(CLK_TYPE_SOC, "SOC Clock");
err = amdsmi_dev_pci_bandwidth_get(device_handles_[i], &b);
err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], &b);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Get PCIE Bandwidth: Not supported on this machine"
<< std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_pci_bandwidth_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) {
std::cout << "\t**Get PCIE Bandwidth "
@@ -164,7 +164,7 @@ void TestFrequenciesRead::Run(void) {
std::cout << b.transfer_rate.num_supported << std::endl;
print_frequencies(&b.transfer_rate, b.lanes);
// Verify api support checking functionality is working
err = amdsmi_dev_pci_bandwidth_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
+10 -10
Zobrazit soubor
@@ -113,7 +113,7 @@ void TestFrequenciesReadWrite::Run(void) {
std::cout << amdsmi_clk << std::endl;
if (amdsmi_clk == CLK_TYPE_PCIE)
return false;
ret = amdsmi_dev_gpu_clk_freq_get(device_handles_[dv_ind], amdsmi_clk, &f);
ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[dv_ind], amdsmi_clk, &f);
std::cout << ret << std::endl;
if (ret == AMDSMI_STATUS_NOT_SUPPORTED ||
@@ -151,7 +151,7 @@ void TestFrequenciesReadWrite::Run(void) {
FreqEnumToStr(amdsmi_clk) << " to 0b" << freq_bm_str << " ..." <<
std::endl;
}
ret = amdsmi_dev_gpu_clk_freq_set(device_handles_[dv_ind], amdsmi_clk, freq_bitmask);
ret = amdsmi_dev_set_clk_freq(device_handles_[dv_ind], amdsmi_clk, freq_bitmask);
//Certain ASICs does not allow to set particular clocks. If set function for a clock returns
//permission error despite root access, manually set ret value to success and return
if (ret == AMDSMI_STATUS_NO_PERM && geteuid() == 0) {
@@ -166,7 +166,7 @@ void TestFrequenciesReadWrite::Run(void) {
return;
}
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_gpu_clk_freq_get(device_handles_[dv_ind], amdsmi_clk, &f);
ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[dv_ind], amdsmi_clk, &f);
if (ret != AMDSMI_STATUS_SUCCESS) {
return;
}
@@ -175,12 +175,12 @@ void TestFrequenciesReadWrite::Run(void) {
std::cout << "Frequency is now index " << f.current << std::endl;
std::cout << "Resetting mask to all frequencies." << std::endl;
}
ret = amdsmi_dev_gpu_clk_freq_set(device_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF);
ret = amdsmi_dev_set_clk_freq(device_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF);
if (ret != AMDSMI_STATUS_SUCCESS) {
return;
}
ret = amdsmi_dev_perf_level_set(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
if (ret != AMDSMI_STATUS_SUCCESS) {
return;
}
@@ -194,7 +194,7 @@ void TestFrequenciesReadWrite::Run(void) {
freq_write();
CHK_ERR_ASRT(ret)
#if 0
ret = amdsmi_dev_gpu_clk_freq_get(dv_ind, amdsmi_clk, &f);
ret = amdsmi_dev_get_gpu_clk_freq(dv_ind, amdsmi_clk, &f);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
@@ -215,20 +215,20 @@ void TestFrequenciesReadWrite::Run(void) {
std::cout << "Setting frequency mask for clock " << amdsmi_clk <<
" to 0b" << freq_bm_str << " ..." << std::endl;
}
ret = amdsmi_dev_gpu_clk_freq_set(dv_ind, amdsmi_clk, freq_bitmask);
ret = amdsmi_dev_set_clk_freq(dv_ind, amdsmi_clk, freq_bitmask);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_gpu_clk_freq_get(dv_ind, amdsmi_clk, &f);
ret = amdsmi_dev_get_gpu_clk_freq(dv_ind, amdsmi_clk, &f);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
std::cout << "Frequency is now index " << f.current << std::endl;
std::cout << "Resetting mask to all frequencies." << std::endl;
}
ret = amdsmi_dev_gpu_clk_freq_set(dv_ind, amdsmi_clk, 0xFFFFFFFF);
ret = amdsmi_dev_set_clk_freq(dv_ind, amdsmi_clk, 0xFFFFFFFF);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_perf_level_set(dv_ind, AMDSMI_DEV_PERF_LEVEL_AUTO);
ret = amdsmi_dev_set_perf_level(dv_ind, AMDSMI_DEV_PERF_LEVEL_AUTO);
CHK_ERR_ASRT(ret)
#endif
}
+1 -1
Zobrazit soubor
@@ -99,7 +99,7 @@ void TestGPUBusyRead::Run(void) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
PrintDeviceHeader(device_handles_[i]);
err = amdsmi_dev_busy_percent_get(device_handles_[i], &val_ui32);
err = amdsmi_dev_get_busy_percent(device_handles_[i], &val_ui32);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_FILE_ERROR) {
IF_VERB(STANDARD) {
+2 -2
Zobrazit soubor
@@ -103,7 +103,7 @@ void TestGpuMetricsRead::Run(void) {
std::cout << "\t**GPU METRICS:\n";
}
amdsmi_gpu_metrics_t smu;
err = amdsmi_dev_gpu_metrics_info_get(device_handles_[i], &smu);
err = amdsmi_dev_get_gpu_metrics_info(device_handles_[i], &smu);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
@@ -188,7 +188,7 @@ void TestGpuMetricsRead::Run(void) {
}
// Verify api support checking functionality is working
err = amdsmi_dev_gpu_metrics_info_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_gpu_metrics_info(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
+22 -22
Zobrazit soubor
@@ -105,11 +105,11 @@ void TestIdInfoRead::Run(void) {
}
// Get the device ID, name, vendor ID and vendor name for the device
err = amdsmi_dev_id_get(device_handles_[i], &id);
err = amdsmi_dev_get_id(device_handles_[i], &id);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
amdsmi_status_t ret;
// Verify api support checking functionality is working
ret = amdsmi_dev_id_get(device_handles_[i], nullptr);
ret = amdsmi_dev_get_id(device_handles_[i], nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
@@ -118,7 +118,7 @@ void TestIdInfoRead::Run(void) {
std::cout << "\t**Device ID: 0x" << std::hex << id << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_id_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_id(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
@@ -132,11 +132,11 @@ void TestIdInfoRead::Run(void) {
err = amdsmi_get_board_info(device_handles_[0], &board_info);
CHK_ERR_ASRT(err)
err = amdsmi_dev_vram_vendor_get(device_handles_[i], buffer, kBufferLen);
err = amdsmi_dev_get_vram_vendor(device_handles_[i], buffer, kBufferLen);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout <<
"\t**Vram Vendor string not supported on this system." << std::endl;
err = amdsmi_dev_vram_vendor_get(device_handles_[i], nullptr, kBufferLen);
err = amdsmi_dev_get_vram_vendor(device_handles_[i], nullptr, kBufferLen);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
@@ -145,10 +145,10 @@ void TestIdInfoRead::Run(void) {
}
}
err = amdsmi_dev_drm_render_minor_get(device_handles_[i], &drm_render_minor);
err = amdsmi_dev_get_drm_render_minor(device_handles_[i], &drm_render_minor);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
// Verify api support checking functionality is working
err = amdsmi_dev_drm_render_minor_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_drm_render_minor(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
@@ -156,15 +156,15 @@ void TestIdInfoRead::Run(void) {
std::cout << "\t**DRM Render Minor: " << drm_render_minor << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_drm_render_minor_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_drm_render_minor(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
err = amdsmi_dev_vendor_name_get(device_handles_[i], buffer, kBufferLen);
err = amdsmi_dev_get_vendor_name(device_handles_[i], buffer, kBufferLen);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Device Vendor name string not found on this system." <<
std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_vendor_name_get(device_handles_[i], nullptr, kBufferLen);
err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
@@ -172,15 +172,15 @@ void TestIdInfoRead::Run(void) {
std::cout << "\t**Device Vendor name: " << buffer << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_vendor_name_get(device_handles_[i], nullptr, kBufferLen);
err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
// Get the device ID, name, vendor ID and vendor name for the sub-device
err = amdsmi_dev_subsystem_id_get(device_handles_[i], &id);
err = amdsmi_dev_get_subsystem_id(device_handles_[i], &id);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
// Verify api support checking functionality is working
err = amdsmi_dev_subsystem_id_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_subsystem_id(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
@@ -188,15 +188,15 @@ void TestIdInfoRead::Run(void) {
std::cout << "\t**Subsystem ID: 0x" << std::hex << id << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_subsystem_id_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_subsystem_id(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
err = amdsmi_dev_subsystem_name_get(device_handles_[i], buffer, kBufferLen);
err = amdsmi_dev_get_subsystem_name(device_handles_[i], buffer, kBufferLen);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Subsystem name string not found on this system." <<
std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_subsystem_name_get(device_handles_[i], nullptr, kBufferLen);
err = amdsmi_dev_get_subsystem_name(device_handles_[i], nullptr, kBufferLen);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
@@ -204,7 +204,7 @@ void TestIdInfoRead::Run(void) {
std::cout << "\t**Subsystem name: " << buffer << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_subsystem_name_get(device_handles_[i], nullptr, kBufferLen);
err = amdsmi_dev_get_subsystem_name(device_handles_[i], nullptr, kBufferLen);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
@@ -213,13 +213,13 @@ void TestIdInfoRead::Run(void) {
asci_info.subvendor_id << std::endl;
}
err = amdsmi_dev_vendor_name_get(device_handles_[i], buffer, kBufferLen);
err = amdsmi_dev_get_vendor_name(device_handles_[i], buffer, kBufferLen);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout <<
"\t**Subsystem Vendor name string not found on this system." <<
std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_vendor_name_get(device_handles_[i], nullptr, kBufferLen);
err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
@@ -227,11 +227,11 @@ void TestIdInfoRead::Run(void) {
std::cout << "\t**Subsystem Vendor name: " << buffer << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_vendor_name_get(device_handles_[i], nullptr, kBufferLen);
err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
err = amdsmi_dev_pci_id_get(device_handles_[i], &val_ui64);
err = amdsmi_dev_get_pci_id(device_handles_[i], &val_ui64);
// Don't check for AMDSMI_STATUS_NOT_SUPPORTED since this should always be
// supported. It is not based on a sysfs file.
CHK_ERR_ASRT(err)
@@ -240,7 +240,7 @@ void TestIdInfoRead::Run(void) {
std::cout << " (" << std::dec << val_ui64 << ")" << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_pci_id_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_pci_id(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
+4 -4
Zobrazit soubor
@@ -96,7 +96,7 @@ void TestMemPageInfoRead::Run(void) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
PrintDeviceHeader(device_handles_[i]);
err = amdsmi_dev_memory_reserved_pages_get(device_handles_[i], &num_pages, nullptr);
err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], &num_pages, nullptr);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout <<
@@ -104,7 +104,7 @@ void TestMemPageInfoRead::Run(void) {
<< std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_memory_reserved_pages_get(device_handles_[i], nullptr, nullptr);
err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], nullptr, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
continue;
@@ -115,7 +115,7 @@ void TestMemPageInfoRead::Run(void) {
std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_memory_reserved_pages_get(device_handles_[i], nullptr, nullptr);
err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], nullptr, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
@@ -124,7 +124,7 @@ void TestMemPageInfoRead::Run(void) {
assert(records != nullptr);
err = amdsmi_dev_memory_reserved_pages_get(device_handles_[i], &num_pages, records);
err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], &num_pages, records);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Getting Memory Page Retirement Status not "
"supported for this device" << std::endl;
+6 -6
Zobrazit soubor
@@ -119,8 +119,8 @@ void TestMemUtilRead::Run(void) {
PrintDeviceHeader(device_handles_[i]);
#if 0
err = amdsmi_dev_memory_busy_percent_get(i, &mem_busy_percent);
err_chk("amdsmi_dev_memory_busy_percent_get()");
err = amdsmi_dev_get_memory_busy_percent(i, &mem_busy_percent);
err_chk("amdsmi_dev_get_memory_busy_percent()");
if (err != AMDSMI_STATUS_SUCCESS) {
return;
}
@@ -131,16 +131,16 @@ void TestMemUtilRead::Run(void) {
#endif
for (uint32_t mem_type = AMDSMI_MEM_TYPE_FIRST;
mem_type <= AMDSMI_MEM_TYPE_LAST; ++mem_type) {
err = amdsmi_dev_memory_total_get(device_handles_[i],
err = amdsmi_dev_get_memory_total(device_handles_[i],
static_cast<amdsmi_memory_type_t>(mem_type), &total);
err_chk("amdsmi_dev_memory_total_get()");
err_chk("amdsmi_dev_get_memory_total()");
if (err != AMDSMI_STATUS_SUCCESS) {
return;
}
err = amdsmi_dev_memory_usage_get(device_handles_[i],
err = amdsmi_dev_get_memory_usage(device_handles_[i],
static_cast<amdsmi_memory_type_t>(mem_type), &usage);
err_chk("amdsmi_dev_memory_usage_get()");
err_chk("amdsmi_dev_get_memory_usage()");
if (err != AMDSMI_STATUS_SUCCESS) {
return;
}
+4 -4
Zobrazit soubor
@@ -106,7 +106,7 @@ void TestMetricsCounterRead::Run(void) {
uint64_t power;
uint64_t timestamp;
float counter_resolution;
err = amdsmi_dev_energy_count_get(device_handles_[i], &power, &counter_resolution, &timestamp);
err = amdsmi_dev_get_energy_count(device_handles_[i], &power, &counter_resolution, &timestamp);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
@@ -128,14 +128,14 @@ void TestMetricsCounterRead::Run(void) {
}
// Verify api support checking functionality is working
err = amdsmi_dev_energy_count_get(device_handles_[i], nullptr, nullptr, nullptr);
err = amdsmi_dev_get_energy_count(device_handles_[i], nullptr, nullptr, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
// Coarse Grain counters
amdsmi_utilization_counter_t utilization_counters[2];
utilization_counters[0].type = AMDSMI_COARSE_GRAIN_GFX_ACTIVITY;
utilization_counters[1].type = AMDSMI_COARSE_GRAIN_MEM_ACTIVITY;
err = amdsmi_utilization_count_get(device_handles_[i], utilization_counters,
err = amdsmi_get_utilization_count(device_handles_[i], utilization_counters,
2, &timestamp);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
@@ -158,7 +158,7 @@ void TestMetricsCounterRead::Run(void) {
}
// Verify api support checking functionality is working
err = amdsmi_utilization_count_get(device_handles_[i], nullptr,
err = amdsmi_get_utilization_count(device_handles_[i], nullptr,
1 , nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
} // end for
+60 -60
Zobrazit soubor
@@ -197,7 +197,7 @@ void TestMutualExclusion::Run(void) {
std::cout << "at " << __FILE__ << ":" << __LINE__ << std::endl; \
} \
}
ret = amdsmi_dev_id_get(device_handles_[0], &dmy_ui16);
ret = amdsmi_dev_get_id(device_handles_[0], &dmy_ui16);
// vendor_id, unique_id
amdsmi_asic_info_t asci_info;
@@ -209,105 +209,105 @@ void TestMutualExclusion::Run(void) {
ret = amdsmi_get_board_info(device_handles_[0], &board_info);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_vendor_name_get(device_handles_[0], dmy_str, 10);
ret = amdsmi_dev_get_vendor_name(device_handles_[0], dmy_str, 10);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_vram_vendor_get(device_handles_[0], dmy_str, 10);
ret = amdsmi_dev_get_vram_vendor(device_handles_[0], dmy_str, 10);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_subsystem_id_get(device_handles_[0], &dmy_ui16);
ret = amdsmi_dev_get_subsystem_id(device_handles_[0], &dmy_ui16);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_pci_id_get(device_handles_[0], &dmy_ui64);
ret = amdsmi_dev_get_pci_id(device_handles_[0], &dmy_ui64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_pci_throughput_get(device_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64);
ret = amdsmi_dev_get_pci_throughput(device_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_pci_replay_counter_get(device_handles_[0], &dmy_ui64);
ret = amdsmi_dev_get_pci_replay_counter(device_handles_[0], &dmy_ui64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_pci_bandwidth_set(device_handles_[0], 0);
ret = amdsmi_dev_set_pci_bandwidth(device_handles_[0], 0);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_fan_rpms_get(device_handles_[0], dmy_ui32, &dmy_i64);
ret = amdsmi_dev_get_fan_rpms(device_handles_[0], dmy_ui32, &dmy_i64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_fan_speed_get(device_handles_[0], 0, &dmy_i64);
ret = amdsmi_dev_get_fan_speed(device_handles_[0], 0, &dmy_i64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_fan_speed_max_get(device_handles_[0], 0, &dmy_ui64);
ret = amdsmi_dev_get_fan_speed_max(device_handles_[0], 0, &dmy_ui64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_temp_metric_get(device_handles_[0], dmy_ui32, AMDSMI_TEMP_CURRENT, &dmy_i64);
ret = amdsmi_dev_get_temp_metric(device_handles_[0], dmy_ui32, AMDSMI_TEMP_CURRENT, &dmy_i64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_fan_reset(device_handles_[0], 0);
ret = amdsmi_dev_reset_fan(device_handles_[0], 0);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_fan_speed_set(device_handles_[0], dmy_ui32, 0);
ret = amdsmi_dev_set_fan_speed(device_handles_[0], dmy_ui32, 0);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_perf_level_get(device_handles_[0], &dmy_perf_lvl);
ret = amdsmi_dev_get_perf_level(device_handles_[0], &dmy_perf_lvl);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_overdrive_level_get(device_handles_[0], &dmy_ui32);
ret = amdsmi_dev_get_overdrive_level(device_handles_[0], &dmy_ui32);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_gpu_clk_freq_get(device_handles_[0], CLK_TYPE_SYS, &dmy_freqs);
ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[0], CLK_TYPE_SYS, &dmy_freqs);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_od_volt_info_get(device_handles_[0], &dmy_od_volt);
ret = amdsmi_dev_get_od_volt_info(device_handles_[0], &dmy_od_volt);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_od_volt_curve_regions_get(device_handles_[0], &dmy_ui32, &dmy_vlt_reg);
ret = amdsmi_dev_get_od_volt_curve_regions(device_handles_[0], &dmy_ui32, &dmy_vlt_reg);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_overdrive_level_set_v1(device_handles_[0], dmy_i32);
ret = amdsmi_dev_set_overdrive_level_v1(device_handles_[0], dmy_i32);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_gpu_clk_freq_set(device_handles_[0], CLK_TYPE_SYS, 0);
ret = amdsmi_dev_set_clk_freq(device_handles_[0], CLK_TYPE_SYS, 0);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_ecc_count_get(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt);
ret = amdsmi_dev_get_ecc_count(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_ecc_enabled_get(device_handles_[0], &dmy_ui64);
ret = amdsmi_dev_get_ecc_enabled(device_handles_[0], &dmy_ui64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_ecc_status_get(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st);
ret = amdsmi_dev_get_ecc_status(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
/* Other functions holding device mutexes. Listed for reference.
amdsmi_dev_sku_get
amdsmi_dev_perf_level_set_v1
amdsmi_dev_od_clk_info_set
amdsmi_dev_od_volt_info_set
amdsmi_dev_set_perf_level_v1
amdsmi_dev_set_od_clk_info
amdsmi_dev_set_od_volt_info
amdsmi_dev_firmware_version_get
amdsmi_dev_firmware_version_get
amdsmi_dev_name_get
amdsmi_dev_brand_get
amdsmi_dev_vram_vendor_get
amdsmi_dev_subsystem_name_get
amdsmi_dev_drm_render_minor_get
amdsmi_dev_vendor_name_get
amdsmi_dev_pci_bandwidth_get
amdsmi_dev_pci_bandwidth_set
amdsmi_dev_pci_throughput_get
amdsmi_dev_temp_metric_get
amdsmi_dev_volt_metric_get
amdsmi_dev_fan_speed_get
amdsmi_dev_fan_rpms_get
amdsmi_dev_fan_reset
amdsmi_dev_fan_speed_set
amdsmi_dev_fan_speed_max_get
amdsmi_dev_od_volt_info_get
amdsmi_dev_gpu_metrics_info_get
amdsmi_dev_od_volt_curve_regions_get
amdsmi_dev_get_vram_vendor
amdsmi_dev_get_subsystem_name
amdsmi_dev_get_drm_render_minor
amdsmi_dev_get_vendor_name
amdsmi_dev_get_pci_bandwidth
amdsmi_dev_set_pci_bandwidth
amdsmi_dev_get_pci_throughput
amdsmi_dev_get_temp_metric
amdsmi_dev_get_volt_metric
amdsmi_dev_get_fan_speed
amdsmi_dev_get_fan_rpms
amdsmi_dev_reset_fan
amdsmi_dev_set_fan_speed
amdsmi_dev_get_fan_speed_max
amdsmi_dev_get_od_volt_info
amdsmi_dev_get_gpu_metrics_info
amdsmi_dev_get_od_volt_curve_regions
amdsmi_dev_power_max_get
amdsmi_dev_power_ave_get
amdsmi_dev_get_power_ave
amdsmi_dev_power_cap_get
amdsmi_dev_power_cap_range_get
amdsmi_dev_power_cap_set
amdsmi_dev_power_profile_presets_get
amdsmi_dev_power_profile_set
amdsmi_dev_memory_total_get
amdsmi_dev_memory_usage_get
amdsmi_dev_memory_busy_percent_get
amdsmi_dev_busy_percent_get
amdsmi_dev_set_power_cap
amdsmi_dev_get_power_profile_presets
amdsmi_dev_set_power_profile
amdsmi_dev_get_memory_total
amdsmi_dev_get_memory_usage
amdsmi_dev_get_memory_busy_percent
amdsmi_dev_get_busy_percent
amdsmi_dev_vbios_version_get
amdsmi_dev_serial_number_get
amdsmi_dev_pci_replay_counter_get
amdsmi_dev_get_pci_replay_counter
amdsmi_dev_unique_id_get
amdsmi_dev_counter_create
amdsmi_counter_available_counters_get
amdsmi_dev_create_counter
amdsmi_counter_get_available_counters
amdsmi_dev_counter_group_supported
amdsmi_dev_memory_reserved_pages_get
amdsmi_dev_get_memory_reserved_pages
amdsmi_dev_xgmi_error_status
amdsmi_dev_xgmi_error_reset
amdsmi_dev_reset_xgmi_error
amdsmi_dev_xgmi_hive_id_get
amdsmi_topo_get_link_weight
amdsmi_event_notification_mask_set
amdsmi_event_notification_init
amdsmi_event_notification_stop
amdsmi_set_event_notification_mask
amdsmi_init_event_notification
amdsmi_stop_event_notification
*/
IF_VERB(STANDARD) {
+2 -2
Zobrazit soubor
@@ -98,12 +98,12 @@ void TestOverdriveRead::Run(void) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
PrintDeviceHeader(device_handles_[i]);
err = amdsmi_dev_overdrive_level_get(device_handles_[i], &val_ui32);
err = amdsmi_dev_get_overdrive_level(device_handles_[i], &val_ui32);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**OverDrive Level:" << val_ui32 << std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_overdrive_level_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_overdrive_level(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
+5 -5
Zobrazit soubor
@@ -100,22 +100,22 @@ void TestOverdriveReadWrite::Run(void) {
IF_VERB(STANDARD) {
std::cout << "Set Overdrive level to 0%..." << std::endl;
}
ret = amdsmi_dev_overdrive_level_set(device_handles_[dv_ind], 0);
ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 0);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
std::cout << "Set Overdrive level to 10%..." << std::endl;
}
ret = amdsmi_dev_overdrive_level_set(device_handles_[dv_ind], 10);
ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 10);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_overdrive_level_get(device_handles_[dv_ind], &val);
ret = amdsmi_dev_get_overdrive_level(device_handles_[dv_ind], &val);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
std::cout << "\t**New OverDrive Level:" << val << std::endl;
std::cout << "Reset Overdrive level to 0%..." << std::endl;
}
ret = amdsmi_dev_overdrive_level_set(device_handles_[dv_ind], 0);
ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 0);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_overdrive_level_get(device_handles_[dv_ind], &val);
ret = amdsmi_dev_get_overdrive_level(device_handles_[dv_ind], &val);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
std::cout << "\t**New OverDrive Level:" << val << std::endl;
+12 -12
Zobrazit soubor
@@ -100,15 +100,15 @@ void TestPciReadWrite::Run(void) {
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
PrintDeviceHeader(device_handles_[dv_ind]);
ret = amdsmi_dev_pci_replay_counter_get(device_handles_[dv_ind], &u64int);
ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], &u64int);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout <<
"\t**amdsmi_dev_pci_replay_counter_get() is not supported"
"\t** amdsmi_dev_get_pci_replay_counter() is not supported"
" on this machine" << std::endl;
// Verify api support checking functionality is working
ret = amdsmi_dev_pci_replay_counter_get(device_handles_[dv_ind], nullptr);
ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(ret)
@@ -116,11 +116,11 @@ void TestPciReadWrite::Run(void) {
std::cout << "\tPCIe Replay Counter: " << u64int << std::endl;
}
// Verify api support checking functionality is working
ret = amdsmi_dev_pci_replay_counter_get(device_handles_[dv_ind], nullptr);
ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
}
ret = amdsmi_dev_pci_throughput_get(device_handles_[dv_ind], &sent, &received, &max_pkt_sz);
ret = amdsmi_dev_get_pci_throughput(device_handles_[dv_ind], &sent, &received, &max_pkt_sz);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "TEST FAILURE: Current PCIe throughput is not detected. "
"This is likely because it is not indicated in the pcie_bw sysfs "
@@ -141,14 +141,14 @@ void TestPciReadWrite::Run(void) {
std::cout << std::endl;
}
ret = amdsmi_dev_pci_bandwidth_get(device_handles_[dv_ind], &bw);
ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], &bw);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "TEST FAILURE: Current PCIe bandwidth is not detected. "
"This is likely because it is not indicated in the pp_dpm_pcie sysfs "
"file. Aborting test." << std::endl;
// Verify api support checking functionality is working
ret = amdsmi_dev_pci_bandwidth_get(device_handles_[dv_ind], nullptr);
ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
return;
@@ -163,7 +163,7 @@ void TestPciReadWrite::Run(void) {
std::endl;
}
// Verify api support checking functionality is working
ret = amdsmi_dev_pci_bandwidth_get(device_handles_[dv_ind], nullptr);
ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
// First set the bitmask to all supported bandwidths
@@ -182,10 +182,10 @@ void TestPciReadWrite::Run(void) {
std::cout << "\tSetting bandwidth mask to " << "0b" << freq_bm_str <<
" ..." << std::endl;
}
ret = amdsmi_dev_pci_bandwidth_set(device_handles_[dv_ind], freq_bitmask);
ret = amdsmi_dev_set_pci_bandwidth(device_handles_[dv_ind], freq_bitmask);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_pci_bandwidth_get(device_handles_[dv_ind], &bw);
ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], &bw);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
@@ -193,10 +193,10 @@ void TestPciReadWrite::Run(void) {
std::endl;
std::cout << "\tResetting mask to all bandwidths." << std::endl;
}
ret = amdsmi_dev_pci_bandwidth_set(device_handles_[dv_ind], 0xFFFFFFFF);
ret = amdsmi_dev_set_pci_bandwidth(device_handles_[dv_ind], 0xFFFFFFFF);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_perf_level_set(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
CHK_ERR_ASRT(ret)
}
}
+13 -13
Zobrazit soubor
@@ -115,20 +115,20 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_device_handle dv_ind,
amdsmi_event_handle_t evt_handle;
amdsmi_status_t ret;
ret = amdsmi_dev_counter_create(dv_ind,
ret = amdsmi_dev_create_counter(dv_ind,
static_cast<amdsmi_event_type_t>(evnt), &evt_handle);
CHK_ERR_ASRT(ret)
// Note that amdsmi_dev_counter_create() should never return
// Note that amdsmi_dev_create_counter() should never return
// AMDSMI_STATUS_NOT_SUPPORTED. It will return AMDSMI_STATUS_OUT_OF_RESOURCES
// if it is unable to create a counter.
ret = amdsmi_dev_counter_create(dv_ind,
ret = amdsmi_dev_create_counter(dv_ind,
static_cast<amdsmi_event_type_t>(evnt), nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
ret = amdsmi_counter_control(evt_handle, AMDSMI_CNTR_CMD_START, nullptr);
ret = amdsmi_control_counter(evt_handle, AMDSMI_CNTR_CMD_START, nullptr);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "amdsmi_counter_control() returned "
std::cout << "amdsmi_control_counter() returned "
"AMDSMI_STATUS_NOT_SUPPORTED" << std::endl;
throw AMDSMI_STATUS_NOT_SUPPORTED;
} else {
@@ -136,7 +136,7 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_device_handle dv_ind,
}
sleep(sleep_sec);
ret = amdsmi_counter_read(evt_handle, val);
ret = amdsmi_read_counter(evt_handle, val);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
@@ -146,7 +146,7 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_device_handle dv_ind,
std::cout << "\t\t\tEvents/Second Running: " <<
val->value/static_cast<float>(val->time_running) << std::endl;
}
ret = amdsmi_dev_counter_destroy(evt_handle);
ret = amdsmi_dev_destroy_counter(evt_handle);
CHK_ERR_ASRT(ret)
}
@@ -261,7 +261,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_device_handle dv_ind) {
std::cout << "Testing Event Group " << grp.name() << std::endl;
}
ret = amdsmi_counter_available_counters_get(dv_ind, grp.group(),
ret = amdsmi_counter_get_available_counters(dv_ind, grp.group(),
&avail_counters);
IF_VERB(STANDARD) {
std::cout << "Available Counters: " << avail_counters << std::endl;
@@ -294,7 +294,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_device_handle dv_ind) {
std::cout << "\tEvent Type " << tmp << std::endl;
}
ret = amdsmi_dev_counter_create(dv_ind,
ret = amdsmi_dev_create_counter(dv_ind,
static_cast<amdsmi_event_type_t>(tmp), &evt_handle.get()[j]);
CHK_ERR_ASRT(ret)
}
@@ -307,11 +307,11 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_device_handle dv_ind) {
for (j = 0; j < num_created; ++j) {
tmp = static_cast<amdsmi_event_type_t>(evnt + j);
ret = amdsmi_counter_control(evt_handle.get()[j], AMDSMI_CNTR_CMD_START,
ret = amdsmi_control_counter(evt_handle.get()[j], AMDSMI_CNTR_CMD_START,
nullptr);
CHK_ERR_ASRT(ret)
ret = amdsmi_counter_available_counters_get(dv_ind, grp.group(),
ret = amdsmi_counter_get_available_counters(dv_ind, grp.group(),
&tmp_cntrs);
CHK_ERR_ASRT(ret)
ASSERT_EQ(tmp_cntrs, (avail_counters - j - 1));
@@ -325,7 +325,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_device_handle dv_ind) {
for (j = 0; j < num_created; ++j) {
tmp = static_cast<amdsmi_event_type_t>(evnt + j);
ret = amdsmi_counter_read(evt_handle.get()[j], &val);
ret = amdsmi_read_counter(evt_handle.get()[j], &val);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
@@ -337,7 +337,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_device_handle dv_ind) {
}
}
for (j = 0; j < num_created; ++j) {
ret = amdsmi_dev_counter_destroy(evt_handle.get()[j]);
ret = amdsmi_dev_destroy_counter(evt_handle.get()[j]);
CHK_ERR_ASRT(ret)
}
}
+5 -5
Zobrazit soubor
@@ -103,7 +103,7 @@ void TestPerfDeterminism::Run(void) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
PrintDeviceHeader(device_handles_[i]);
err = amdsmi_dev_od_volt_info_get(device_handles_[i], &odv);
err = amdsmi_dev_get_od_volt_info(device_handles_[i], &odv);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout << "\t** Not supported on this machine" << std::endl;
@@ -114,14 +114,14 @@ void TestPerfDeterminism::Run(void) {
clkvalue = (odv.curr_sclk_range.lower_bound/1000000) + 50;
}
err = amdsmi_perf_determinism_mode_set(device_handles_[i], clkvalue);
err = amdsmi_set_perf_determinism_mode(device_handles_[i], clkvalue);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout << "\t**Not supported on this machine" << std::endl;
}
return;
} else {
ret = amdsmi_dev_perf_level_get(device_handles_[i], &pfl);
ret = amdsmi_dev_get_perf_level(device_handles_[i], &pfl);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) <<
@@ -130,9 +130,9 @@ void TestPerfDeterminism::Run(void) {
}
std::cout << "\t**Resetting performance determinism" << std::endl;
err = amdsmi_dev_perf_level_set(device_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);;
err = amdsmi_dev_set_perf_level(device_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);;
CHK_ERR_ASRT(err)
ret = amdsmi_dev_perf_level_get(device_handles_[i], &pfl);
ret = amdsmi_dev_get_perf_level(device_handles_[i], &pfl);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) <<
+2 -2
Zobrazit soubor
@@ -98,14 +98,14 @@ void TestPerfLevelRead::Run(void) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
PrintDeviceHeader(device_handles_[i]);
err = amdsmi_dev_perf_level_get(device_handles_[i], &pfl);
err = amdsmi_dev_get_perf_level(device_handles_[i], &pfl);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Performance Level:" << std::dec << (uint32_t)pfl <<
std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_perf_level_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_perf_level(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
+5 -5
Zobrazit soubor
@@ -101,7 +101,7 @@ void TestPerfLevelReadWrite::Run(void) {
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
PrintDeviceHeader(device_handles_[dv_ind]);
ret = amdsmi_dev_perf_level_get(device_handles_[dv_ind], &orig_pfl);
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &orig_pfl);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
@@ -120,14 +120,14 @@ void TestPerfLevelReadWrite::Run(void) {
GetPerfLevelStr(static_cast<amdsmi_dev_perf_level_t>(pfl_i)) <<
" ..." << std::endl;
}
ret = amdsmi_dev_perf_level_set(device_handles_[dv_ind],
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind],
static_cast<amdsmi_dev_perf_level_t>(pfl_i));
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**" << GetPerfLevelStr(static_cast<amdsmi_dev_perf_level_t>(pfl_i))
<< " returned AMDSMI_STATUS_NOT_SUPPORTED" << std::endl;
} else {
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_perf_level_get(device_handles_[dv_ind], &pfl);
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) <<
@@ -139,9 +139,9 @@ void TestPerfLevelReadWrite::Run(void) {
std::cout << "Reset Perf level to " << GetPerfLevelStr(orig_pfl) <<
" ..." << std::endl;
}
ret = amdsmi_dev_perf_level_set(device_handles_[dv_ind], orig_pfl);
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], orig_pfl);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_perf_level_get(device_handles_[dv_ind], &pfl);
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
+2 -2
Zobrazit soubor
@@ -121,7 +121,7 @@ void TestPowerCapReadWrite::Run(void) {
std::cout << "Setting new cap to " << new_cap << "..." << std::endl;
}
start = clock();
ret = amdsmi_dev_power_cap_set(device_handles_[dv_ind], 0, new_cap);
ret = amdsmi_dev_set_power_cap(device_handles_[dv_ind], 0, new_cap);
end = clock();
cpu_time_used = ((double) (end - start)) * 1000000UL / CLOCKS_PER_SEC;
@@ -139,7 +139,7 @@ void TestPowerCapReadWrite::Run(void) {
std::cout << "Resetting cap to " << orig << "..." << std::endl;
}
ret = amdsmi_dev_power_cap_set(device_handles_[dv_ind], 0, orig);
ret = amdsmi_dev_set_power_cap(device_handles_[dv_ind], 0, orig);
CHK_ERR_ASRT(ret)
ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info);
+2 -2
Zobrazit soubor
@@ -112,7 +112,7 @@ void TestPowerRead::Run(void) {
info.max_power_cap << " uW" << std::endl;
}
err = amdsmi_dev_power_ave_get(device_handles_[i], 0, &val_ui64);
err = amdsmi_dev_get_power_ave(device_handles_[i], 0, &val_ui64);
IF_VERB(STANDARD) {
std::cout << "\t**Averge Power Usage: ";
CHK_AMDSMI_PERM_ERR(err)
@@ -120,7 +120,7 @@ void TestPowerRead::Run(void) {
std::cout << static_cast<float>(val_ui64)/1000 << " mW" << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_power_ave_get(device_handles_[i], 0, nullptr);
err = amdsmi_dev_get_power_ave(device_handles_[i], 0, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
+8 -8
Zobrazit soubor
@@ -122,7 +122,7 @@ void TestPowerReadWrite::Run(void) {
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
PrintDeviceHeader(device_handles_[dv_ind]);
ret = amdsmi_dev_power_profile_presets_get(device_handles_[dv_ind], 0, &status);
ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "The power profile presets settings is not supported. "
<< std::endl;
@@ -131,7 +131,7 @@ void TestPowerReadWrite::Run(void) {
CHK_ERR_ASRT(ret)
// Verify api support checking functionality is working
ret = amdsmi_dev_power_profile_presets_get(device_handles_[dv_ind], 0, nullptr);
ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
IF_VERB(STANDARD) {
@@ -172,27 +172,27 @@ void TestPowerReadWrite::Run(void) {
return;
}
ret = amdsmi_dev_power_profile_set(device_handles_[dv_ind], 0, new_prof);
ret = amdsmi_dev_set_power_profile(device_handles_[dv_ind], 0, new_prof);
CHK_ERR_ASRT(ret)
amdsmi_dev_perf_level_t pfl;
ret = amdsmi_dev_perf_level_get(device_handles_[dv_ind], &pfl);
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl);
CHK_ERR_ASRT(ret)
ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_MANUAL);
ret = amdsmi_dev_power_profile_presets_get(device_handles_[dv_ind], 0, &status);
ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status);
CHK_ERR_ASRT(ret)
ASSERT_EQ(status.current, new_prof);
ret = amdsmi_dev_perf_level_set(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_perf_level_get(device_handles_[dv_ind], &pfl);
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl);
CHK_ERR_ASRT(ret)
ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_AUTO);
ret = amdsmi_dev_power_profile_presets_get(device_handles_[dv_ind], 0, &status);
ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status);
CHK_ERR_ASRT(ret)
ASSERT_EQ(status.current, orig_profile);
+8 -8
Zobrazit soubor
@@ -104,7 +104,7 @@ void TestProcInfoRead::Run(void) {
uint32_t num_devices = num_monitor_devs();
err = amdsmi_compute_process_info_get(nullptr, &num_proc_found);
err = amdsmi_get_compute_process_info(nullptr, &num_proc_found);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
@@ -129,7 +129,7 @@ void TestProcInfoRead::Run(void) {
procs = new amdsmi_process_info_t[num_proc_found];
val_ui32 = num_proc_found;
err = amdsmi_compute_process_info_get(procs, &val_ui32);
err = amdsmi_get_compute_process_info(procs, &val_ui32);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_INSUFFICIENT_SIZE) {
IF_VERB(STANDARD) {
@@ -162,7 +162,7 @@ void TestProcInfoRead::Run(void) {
uint32_t amt_allocd = num_devices;
for (uint32_t j = 0; j < num_proc_found; j++) {
err = amdsmi_compute_process_gpus_get(procs[j].process_id, dev_inds,
err = amdsmi_get_compute_process_gpus(procs[j].process_id, dev_inds,
&amt_allocd);
if (err == AMDSMI_STATUS_NOT_FOUND) {
std::cout << "\t** Process " << procs[j].process_id <<
@@ -191,13 +191,13 @@ void TestProcInfoRead::Run(void) {
amdsmi_process_info_t proc_info;
for (uint32_t j = 0; j < num_proc_found; j++) {
memset(&proc_info, 0x0, sizeof(amdsmi_process_info_t));
err = amdsmi_compute_process_info_by_pid_get(procs[j].process_id,
err = amdsmi_get_compute_process_info_by_pid(procs[j].process_id,
&proc_info);
if (err == AMDSMI_STATUS_NOT_FOUND) {
std::cout <<
"\t** WARNING: amdsmi_compute_process_info_get() found process " <<
"\t** WARNING: amdsmi_get_compute_process_info() found process " <<
procs[j].process_id << ", but subsequently, "
"amdsmi_compute_process_info_by_pid_get() did not"
"amdsmi_get_compute_process_info_by_pid() did not"
" find this same process." << std::endl;
} else {
CHK_ERR_ASRT(err)
@@ -217,10 +217,10 @@ void TestProcInfoRead::Run(void) {
if (num_proc_found > 1) {
amdsmi_process_info_t tmp_proc;
val_ui32 = 1;
err = amdsmi_compute_process_info_get(&tmp_proc, &val_ui32);
err = amdsmi_get_compute_process_info(&tmp_proc, &val_ui32);
if (err != AMDSMI_STATUS_INSUFFICIENT_SIZE) {
std::cout << "Expected amdsmi_compute_process_info_get() to tell us"
std::cout << "Expected amdsmi_get_compute_process_info() to tell us"
" there are more processes available, but instead go return code " <<
err << std::endl;
}
+5 -5
Zobrazit soubor
@@ -128,24 +128,24 @@ void TestSysInfoRead::Run(void) {
}
}
err = amdsmi_dev_pci_id_get(device_handles_[i], &val_ui64);
err = amdsmi_dev_get_pci_id(device_handles_[i], &val_ui64);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**PCI ID (BDFID): 0x" << std::hex << val_ui64;
std::cout << " (" << std::dec << val_ui64 << ")" << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_pci_id_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_pci_id(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
err = amdsmi_topo_numa_affinity_get(device_handles_[i], &val_ui32);
err = amdsmi_topo_get_numa_affinity(device_handles_[i], &val_ui32);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**NUMA NODE: 0x" << std::hex << val_ui32;
std::cout << " (" << std::dec << val_ui32 << ")" << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_topo_numa_affinity_get(device_handles_[i], nullptr);
err = amdsmi_topo_get_numa_affinity(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
@@ -177,7 +177,7 @@ void TestSysInfoRead::Run(void) {
}
}
err = amdsmi_version_get(&ver);
err = amdsmi_get_version(&ver);
CHK_ERR_ASRT(err)
ASSERT_TRUE(ver.major != 0xFFFFFFFF && ver.minor != 0xFFFFFFFF &&
+3 -3
Zobrazit soubor
@@ -114,7 +114,7 @@ void TestTempRead::Run(void) {
auto print_temp_metric = [&](amdsmi_temperature_metric_t met,
std::string label) {
err = amdsmi_dev_temp_metric_get(device_handles_[i], type, met, &val_i64);
err = amdsmi_dev_get_temp_metric(device_handles_[i], type, met, &val_i64);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
@@ -124,7 +124,7 @@ void TestTempRead::Run(void) {
}
// Verify api support checking functionality is working
err = amdsmi_dev_temp_metric_get(device_handles_[i], type, met, nullptr);
err = amdsmi_dev_get_temp_metric(device_handles_[i], type, met, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
return;
} else {
@@ -132,7 +132,7 @@ void TestTempRead::Run(void) {
}
}
// Verify api support checking functionality is working
err = amdsmi_dev_temp_metric_get(device_handles_[i], type, met, nullptr);
err = amdsmi_dev_get_temp_metric(device_handles_[i], type, met, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
IF_VERB(STANDARD) {
+2 -2
Zobrazit soubor
@@ -101,7 +101,7 @@ void TestVersionRead::Run(void) {
return;
}
err = amdsmi_version_get(&ver);
err = amdsmi_get_version(&ver);
CHK_ERR_ASRT(err)
ASSERT_TRUE(ver.major != 0xFFFFFFFF && ver.minor != 0xFFFFFFFF &&
@@ -114,7 +114,7 @@ void TestVersionRead::Run(void) {
char ver_str[kVerMaxStrLen];
for (uint32_t cmp = AMDSMI_SW_COMP_FIRST; cmp <= AMDSMI_SW_COMP_LAST; ++cmp) {
err = amdsmi_version_str_get(static_cast<amdsmi_sw_component_t>(cmp),
err = amdsmi_get_version_str(static_cast<amdsmi_sw_component_t>(cmp),
ver_str, kVerMaxStrLen);
CHK_ERR_ASRT(err)
+5 -5
Zobrazit soubor
@@ -157,20 +157,20 @@ void TestVoltCurvRead::Run(void) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
PrintDeviceHeader(device_handles_[i]);
err = amdsmi_dev_od_volt_info_get(device_handles_[i], &odv);
err = amdsmi_dev_get_od_volt_info(device_handles_[i], &odv);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout <<
"\t**amdsmi_dev_od_volt_info_get: Not supported on this machine"
"\t** amdsmi_dev_get_od_volt_info: Not supported on this machine"
<< std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_od_volt_info_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_od_volt_info(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
// Verify api support checking functionality is working
err = amdsmi_dev_od_volt_info_get(device_handles_[i], nullptr);
err = amdsmi_dev_get_od_volt_info(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
@@ -184,7 +184,7 @@ void TestVoltCurvRead::Run(void) {
ASSERT_TRUE(regions != nullptr);
num_regions = odv.num_regions;
err = amdsmi_dev_od_volt_curve_regions_get(device_handles_[i], &num_regions, regions);
err = amdsmi_dev_get_od_volt_curve_regions(device_handles_[i], &num_regions, regions);
CHK_ERR_ASRT(err)
ASSERT_TRUE(num_regions == odv.num_regions);
+3 -3
Zobrazit soubor
@@ -104,7 +104,7 @@ void TestVoltRead::Run(void) {
auto print_volt_metric = [&](amdsmi_voltage_metric_t met,
std::string label) {
err = amdsmi_dev_volt_metric_get(device_handles_[i], type, met, &val_i64);
err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, &val_i64);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
@@ -113,7 +113,7 @@ void TestVoltRead::Run(void) {
"Not supported on this machine" << std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_volt_metric_get(device_handles_[i], type, met, nullptr);
err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
return;
}
@@ -122,7 +122,7 @@ void TestVoltRead::Run(void) {
}
}
// Verify api support checking functionality is working
err = amdsmi_dev_volt_metric_get(device_handles_[i], type, met, nullptr);
err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
IF_VERB(STANDARD) {
+1 -1
Zobrazit soubor
@@ -140,7 +140,7 @@ void TestXGMIReadWrite::Run(void) {
// TODO(cfree) We need to find a way to generate xgmi errors so this
// test won't be meaningless
err = amdsmi_dev_xgmi_error_reset(device);
err = amdsmi_dev_reset_xgmi_error(device);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Successfully reset XGMI Error Status: " << std::endl;
+2 -2
Zobrazit soubor
@@ -167,7 +167,7 @@ void TestBase::PrintDeviceHeader(amdsmi_device_handle dv_ind) {
IF_VERB(STANDARD) {
std::cout << "\t**Device handle: " << dv_ind << std::endl;
}
err = amdsmi_dev_id_get(dv_ind, &val_ui16);
err = amdsmi_dev_get_id(dv_ind, &val_ui16);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Device ID: 0x" << std::hex << val_ui16 << std::endl;
@@ -187,7 +187,7 @@ void TestBase::PrintDeviceHeader(amdsmi_device_handle dv_ind) {
}
}
err = amdsmi_dev_subsystem_id_get(dv_ind, &val_ui16);
err = amdsmi_dev_get_subsystem_id(dv_ind, &val_ui16);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Subsystem ID: 0x" << std::hex << val_ui16 << std::endl;