Skip to content

Commit

Permalink
fix: Update power CTS to handle new GPU/Memory domains
Browse files Browse the repository at this point in the history
Related-To: NEO-13195

Signed-off-by: shubham kumar <[email protected]>
  • Loading branch information
shubskmr committed Nov 8, 2024
1 parent ae0ea49 commit 2b18029
Show file tree
Hide file tree
Showing 5 changed files with 336 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,13 @@ TEST_F(
<< _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
}
for (auto power_handle : power_handles) {
auto energy_threshold = lzt::get_power_energy_threshold(power_handle);
zes_energy_threshold_t energy_threshold = {};
auto status =
lzt::get_power_energy_threshold(power_handle, &energy_threshold);
if (status == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) {
continue;
}
EXPECT_EQ(status, ZE_RESULT_SUCCESS);
// Aim to receive event for energy threshold after setting energy
// threshold 25% more than current threshold
double threshold =
Expand Down Expand Up @@ -490,7 +496,13 @@ TEST_F(
<< _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
}
for (auto power_handle : power_handles) {
auto energy_threshold = lzt::get_power_energy_threshold(power_handle);
zes_energy_threshold_t energy_threshold = {};
auto status =
lzt::get_power_energy_threshold(power_handle, &energy_threshold);
if (status == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) {
continue;
}
EXPECT_EQ(status, ZE_RESULT_SUCCESS);
// Aim to receive event for energy threshold after setting energy
// threshold 25% more than current threshold
double threshold =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,20 @@ TEST_F(FREQUENCY_TEST, GivenValidFrequencyHandleThenCheckForThrottling) {
for (auto p_power_handle : p_power_handles) {
EXPECT_NE(nullptr, p_power_handle);
zes_power_sustained_limit_t power_sustained_limit_Initial;
lzt::get_power_limits(p_power_handle, &power_sustained_limit_Initial,
auto status = lzt::get_power_limits(p_power_handle, &power_sustained_limit_Initial,
nullptr, nullptr);
if (status == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) {
continue;
}
EXPECT_EQ(status, ZE_RESULT_SUCCESS);
zes_power_sustained_limit_t power_sustained_limit_set;
power_sustained_limit_set.power = 0;
lzt::set_power_limits(p_power_handle, &power_sustained_limit_set,
status = lzt::set_power_limits(p_power_handle, &power_sustained_limit_set,
nullptr, nullptr);
if (status == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) {
continue;
}
EXPECT_EQ(status, ZE_RESULT_SUCCESS);
auto before_throttletime = lzt::get_throttle_time(pfreq_handle);
zes_freq_throttle_time_t throttletime;
#ifdef USE_ZESINIT
Expand All @@ -596,8 +604,12 @@ TEST_F(FREQUENCY_TEST, GivenValidFrequencyHandleThenCheckForThrottling) {
after_throttletime.throttleTime);
EXPECT_NE(before_throttletime.timestamp,
after_throttletime.timestamp);
lzt::set_power_limits(p_power_handle, &power_sustained_limit_Initial,
status = lzt::set_power_limits(p_power_handle, &power_sustained_limit_Initial,
nullptr, nullptr);
if (status == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) {
continue;
}
EXPECT_EQ(status, ZE_RESULT_SUCCESS);
}
}
}
Expand Down
Loading

0 comments on commit 2b18029

Please sign in to comment.