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 <shubham.kumar@intel.com>
  • Loading branch information
shubskmr committed Nov 7, 2024
1 parent ae0ea49 commit e7e8f4c
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,12 @@ 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;
}
// Aim to receive event for energy threshold after setting energy
// threshold 25% more than current threshold
double threshold =
Expand Down Expand Up @@ -490,7 +495,12 @@ 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;
}
// 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,18 @@ 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;
}
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;
}
auto before_throttletime = lzt::get_throttle_time(pfreq_handle);
zes_freq_throttle_time_t throttletime;
#ifdef USE_ZESINIT
Expand All @@ -596,8 +602,11 @@ 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;
}
}
}
}
Expand Down
Loading

0 comments on commit e7e8f4c

Please sign in to comment.