Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CTS to validate device reset ext #43

Merged
merged 4 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,16 @@ TEST_F(
}
}

TEST_F(
SYSMAN_DEVICE_TEST,
GivenValidDeviceWhenResettingSysmanDeviceThenSysmanDeviceResetIsSucceded) {
TEST_F(SYSMAN_DEVICE_TEST,
GivenValidDeviceWhenResettingSysmanDeviceThenSysmanDeviceResetSucceeds) {
for (auto device : devices) {
lzt::sysman_device_reset(device);
}
}

TEST_F(
SYSMAN_DEVICE_TEST,
GivenValidDeviceWhenResettingSysmanDeviceNnumberOfTimesThenSysmanDeviceResetAlwaysSucceded) {
GivenValidDeviceWhenResettingSysmanDeviceNnumberOfTimesThenSysmanDeviceResetAlwaysSucceeds) {
int number_iterations = 2;
for (int i = 0; i < number_iterations; i++) {
for (auto device : devices) {
Expand Down Expand Up @@ -466,6 +465,14 @@ void compute_workload(workload_thread_parameters *t_params) {
lzt::destroy_module(module);
}

void set_reset_properties(zes_reset_properties_t &properties, ze_bool_t force,
vishnu-khanth marked this conversation as resolved.
Show resolved Hide resolved
zes_reset_type_t type) {
properties.stype = ZES_STRUCTURE_TYPE_RESET_PROPERTIES;
properties.pNext = nullptr;
properties.force = force;
properties.resetType = type;
}

TEST_F(
SYSMAN_DEVICE_TEST,
GivenValidDeviceWhenRetrievingProcessesStateAndDeviceMemoryIsAllocatedThenMemorySizeIsReturnedCorrectly) {
Expand Down Expand Up @@ -643,5 +650,28 @@ TEST_F(
}
}
}

TEST_F(SYSMAN_DEVICE_TEST,
GivenValidDeviceWhenWarmResettingDeviceThenDeviceResetExtSucceeds) {
for (auto device : devices) {
zes_reset_properties_t properties{};
set_reset_properties(properties, false, ZES_RESET_TYPE_WARM);
lzt::sysman_device_reset_ext(device, properties);
}
}
TEST_F(SYSMAN_DEVICE_TEST,
GivenValidDeviceWhenColdResettingDeviceThenDeviceResetExtSucceeds) {
for (auto device : devices) {
zes_reset_properties_t properties{};
set_reset_properties(properties, false, ZES_RESET_TYPE_COLD);
lzt::sysman_device_reset_ext(device, properties);
}
}
TEST_F(SYSMAN_DEVICE_TEST,
GivenValidDeviceWhenFlrResettingDeviceThenDeviceResetExtSucceeds) {
for (auto device : devices) {
zes_reset_properties_t properties{};
set_reset_properties(properties, false, ZES_RESET_TYPE_FLR);
lzt::sysman_device_reset_ext(device, properties);
}
}
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ zes_device_state_t get_device_state(zes_device_handle_t device);
std::vector<zes_process_state_t> get_processes_state(zes_device_handle_t device,
uint32_t &count);

void sysman_device_reset_ext(zes_device_handle_t device,
zes_reset_properties_t &properties);

} // namespace level_zero_tests

#endif
5 changes: 5 additions & 0 deletions utils/test_harness/sysman/src/test_harness_sysman_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ zes_device_state_t get_device_state(zes_device_handle_t device) {
return state;
}

void sysman_device_reset_ext(zes_device_handle_t device,
zes_reset_properties_t &properties) {
EXPECT_EQ(ZE_RESULT_SUCCESS, zesDeviceResetExt(device, &properties));
}

} // namespace level_zero_tests