Fix unit test errors

Add unit test error handling for set freq and volt.

Change-Id: I5877f8300b942caac8f38e6efc03264bfc432def


[ROCm/amdsmi commit: 4307330cb0]
このコミットが含まれているのは:
Bill(Shuzhou) Liu
2023-07-10 08:50:06 -05:00
committed by Shuzhou Liu
コミット fa6f0f5ea0
2個のファイルの変更12行の追加3行の削除
+6
ファイルの表示
@@ -176,6 +176,12 @@ void TestFrequenciesReadWrite::Run(void) {
std::cout << "Resetting mask to all frequencies." << std::endl; std::cout << "Resetting mask to all frequencies." << std::endl;
} }
ret = amdsmi_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF); ret = amdsmi_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Set all frequencies: Not supported on this machine. Skipping..."
<< std::endl;
ret = AMDSMI_STATUS_SUCCESS;
return;
}
if (ret != AMDSMI_STATUS_SUCCESS) { if (ret != AMDSMI_STATUS_SUCCESS) {
return; return;
} }
+6 -3
ファイルの表示
@@ -158,15 +158,18 @@ void TestVoltCurvRead::Run(void) {
PrintDeviceHeader(processor_handles_[i]); PrintDeviceHeader(processor_handles_[i]);
err = amdsmi_get_gpu_od_volt_info(processor_handles_[i], &odv); err = amdsmi_get_gpu_od_volt_info(processor_handles_[i], &odv);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) { if (err == AMDSMI_STATUS_NOT_SUPPORTED
|| err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) {
IF_VERB(STANDARD) { IF_VERB(STANDARD) {
std::cout << std::cout <<
"\t** amdsmi_get_gpu_od_volt_info: Not supported on this machine" "\t** amdsmi_get_gpu_od_volt_info: Not supported on this machine"
<< std::endl; << std::endl;
} }
// Verify api support checking functionality is working // Verify api support checking functionality is working
err = amdsmi_get_gpu_od_volt_info(processor_handles_[i], nullptr); if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); err = amdsmi_get_gpu_od_volt_info(processor_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
}
} else { } else {
CHK_ERR_ASRT(err) CHK_ERR_ASRT(err)
// Verify api support checking functionality is working // Verify api support checking functionality is working