diff --git a/conformance_tests/sysman/test_sysman_performance/src/test_sysman_performance.cpp b/conformance_tests/sysman/test_sysman_performance/src/test_sysman_performance.cpp index 0eab4827..4b6c9523 100644 --- a/conformance_tests/sysman/test_sysman_performance/src/test_sysman_performance.cpp +++ b/conformance_tests/sysman/test_sysman_performance/src/test_sysman_performance.cpp @@ -18,10 +18,16 @@ namespace lzt = level_zero_tests; namespace { #ifdef USE_ZESINIT -class PerformanceModuleZesTest : public lzt::ZesSysmanCtsClass {}; +class PerformanceModuleZesTest : public lzt::ZesSysmanCtsClass { +public: + bool is_performance_supported = false; +}; #define PERFORMANCE_TEST PerformanceModuleZesTest #else // USE_ZESINIT -class PerformanceModuleTest : public lzt::SysmanCtsClass {}; +class PerformanceModuleTest : public lzt::SysmanCtsClass { +public: + bool is_performance_supported = false; +}; #define PERFORMANCE_TEST PerformanceModuleTest #endif // USE_ZESINIT @@ -31,11 +37,16 @@ LZT_TEST_F( for (auto device : devices) { uint32_t count = 0; count = lzt::get_performance_handle_count(device); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + } else { + LOG_INFO << "No performance handles found for this device! "; } } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; + } } LZT_TEST_F( @@ -43,17 +54,22 @@ LZT_TEST_F( GivenComponentCountZeroWhenRetrievingSysmanPerformanceThenNotNullPerformanceHandlesAreReturned) { for (auto device : devices) { uint32_t count = 0; - auto performance_handles = lzt::get_performance_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - ASSERT_EQ(performance_handles.size(), count); - for (auto performance_handle : performance_handles) { - ASSERT_NE(nullptr, performance_handle); + count = lzt::get_performance_handle_count(device); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + auto performance_handles = lzt::get_performance_handles(device, count); + ASSERT_EQ(performance_handles.size(), count); + for (auto performance_handle : performance_handles) { + ASSERT_NE(nullptr, performance_handle); + } + } else { + LOG_INFO << "No performance handles found for this device! "; } } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; + } } LZT_TEST_F( @@ -61,15 +77,20 @@ LZT_TEST_F( GivenInvalidComponentCountWhenRetrievingPerformanceHandlesThenActualComponentCountIsUpdated) { for (auto device : devices) { uint32_t actual_count = 0; - lzt::get_performance_handles(device, actual_count); - if (actual_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + actual_count = lzt::get_performance_handle_count(device); + if (actual_count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + lzt::get_performance_handles(device, actual_count); + uint32_t test_count = actual_count + 1; + lzt::get_performance_handles(device, test_count); + EXPECT_EQ(test_count, actual_count); + } else { + LOG_INFO << "No performance handles found for this device! "; } - - uint32_t test_count = actual_count + 1; - lzt::get_performance_handles(device, test_count); - EXPECT_EQ(test_count, actual_count); + } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; } } @@ -78,24 +99,28 @@ LZT_TEST_F( GivenValidComponentCountWhenCallingApiTwiceThenSimilarPerformanceHandlesReturned) { for (auto device : devices) { uint32_t count = 0; - auto performance_handles_initial = - lzt::get_performance_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto performance_handle : performance_handles_initial) { - ASSERT_NE(nullptr, performance_handle); - } - - count = 0; - auto performance_handles_later = - lzt::get_performance_handles(device, count); - for (auto performance_handle : performance_handles_later) { - ASSERT_NE(nullptr, performance_handle); + count = lzt::get_performance_handle_count(device); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + auto performance_handles_initial = + lzt::get_performance_handles(device, count); + for (auto performance_handle : performance_handles_initial) { + ASSERT_NE(nullptr, performance_handle); + } + count = 0; + auto performance_handles_later = + lzt::get_performance_handles(device, count); + for (auto performance_handle : performance_handles_later) { + ASSERT_NE(nullptr, performance_handle); + } + EXPECT_EQ(performance_handles_initial, performance_handles_later); + } else { + LOG_INFO << "No performance handles found for this device! "; } - EXPECT_EQ(performance_handles_initial, performance_handles_later); + } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; } } @@ -105,26 +130,30 @@ LZT_TEST_F( for (auto device : devices) { auto deviceProperties = lzt::get_sysman_device_properties(device); uint32_t count = 0; - auto performance_handles = lzt::get_performance_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto performance_handle : performance_handles) { - ASSERT_NE(nullptr, performance_handle); - auto properties = lzt::get_performance_properties(performance_handle); - - if (properties.onSubdevice) { - EXPECT_LT(properties.subdeviceId, deviceProperties.numSubdevices); + count = lzt::get_performance_handle_count(device); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + auto performance_handles = lzt::get_performance_handles(device, count); + for (auto performance_handle : performance_handles) { + ASSERT_NE(nullptr, performance_handle); + auto properties = lzt::get_performance_properties(performance_handle); + if (properties.onSubdevice) { + EXPECT_LT(properties.subdeviceId, deviceProperties.numSubdevices); + } + EXPECT_GE(properties.engines, 0); + EXPECT_LE(properties.engines, + ZES_ENGINE_TYPE_FLAG_OTHER | ZES_ENGINE_TYPE_FLAG_COMPUTE | + ZES_ENGINE_TYPE_FLAG_3D | ZES_ENGINE_TYPE_FLAG_MEDIA | + ZES_ENGINE_TYPE_FLAG_DMA); } - EXPECT_GE(properties.engines, 0); - EXPECT_LE(properties.engines, - ZES_ENGINE_TYPE_FLAG_OTHER | ZES_ENGINE_TYPE_FLAG_COMPUTE | - ZES_ENGINE_TYPE_FLAG_3D | ZES_ENGINE_TYPE_FLAG_MEDIA | - ZES_ENGINE_TYPE_FLAG_DMA); + } else { + LOG_INFO << "No performance handles found for this device! "; } } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; + } } LZT_TEST_F( @@ -132,25 +161,30 @@ LZT_TEST_F( GivenValidPerformanceHandleWhenRetrievingPerformancePropertiesThenExpectSamePropertiesReturnedTwice) { for (auto device : devices) { uint32_t count = 0; - auto performance_handles = lzt::get_performance_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto performance_handle : performance_handles) { - ASSERT_NE(nullptr, performance_handle); - auto properties_initial = - lzt::get_performance_properties(performance_handle); - auto properties_later = - lzt::get_performance_properties(performance_handle); - - if (properties_initial.onSubdevice && properties_later.onSubdevice) { - EXPECT_EQ(properties_initial.subdeviceId, properties_later.subdeviceId); + count = lzt::get_performance_handle_count(device); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + auto performance_handles = lzt::get_performance_handles(device, count); + for (auto performance_handle : performance_handles) { + ASSERT_NE(nullptr, performance_handle); + auto properties_initial = + lzt::get_performance_properties(performance_handle); + auto properties_later = + lzt::get_performance_properties(performance_handle); + if (properties_initial.onSubdevice && properties_later.onSubdevice) { + EXPECT_EQ(properties_initial.subdeviceId, + properties_later.subdeviceId); + } + EXPECT_EQ(properties_initial.engines, properties_later.engines); } - EXPECT_EQ(properties_initial.engines, properties_later.engines); + } else { + LOG_INFO << "No performance handles found for this device! "; } } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; + } } LZT_TEST_F( @@ -158,23 +192,28 @@ LZT_TEST_F( GivenValidPerformanceHandleWhenSettingPerformanceConfigurationThenSuccessIsReturned) { for (auto device : devices) { uint32_t count = 0; - auto performance_handles = lzt::get_performance_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto performance_handle : performance_handles) { - ASSERT_NE(nullptr, performance_handle); - auto initialFactor = lzt::get_performance_config(performance_handle); - double factor = 50; // Check with a random factor value within its range - lzt::set_performance_config(performance_handle, factor); - auto getFactor = lzt::get_performance_config(performance_handle); - EXPECT_GE(getFactor, 0); - EXPECT_LE(getFactor, 100); - lzt::set_performance_config(performance_handle, initialFactor); + count = lzt::get_performance_handle_count(device); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + auto performance_handles = lzt::get_performance_handles(device, count); + for (auto performance_handle : performance_handles) { + ASSERT_NE(nullptr, performance_handle); + auto initialFactor = lzt::get_performance_config(performance_handle); + double factor = 50; // Check with a random factor value within its range + lzt::set_performance_config(performance_handle, factor); + auto getFactor = lzt::get_performance_config(performance_handle); + EXPECT_GE(getFactor, 0); + EXPECT_LE(getFactor, 100); + lzt::set_performance_config(performance_handle, initialFactor); + } + } else { + LOG_INFO << "No performance handles found for this device! "; } } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; + } } static double set_performance_factor(zes_perf_handle_t pHandle, @@ -189,44 +228,50 @@ LZT_TEST_F( GivenValidPerformanceHandleWhenSettingMultiplePerformanceConfigurationsForMediaThenValidPerformanceFactorIsReturned) { for (auto device : devices) { uint32_t count = 0; - auto performance_handles = lzt::get_performance_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - for (auto performance_handle : performance_handles) { - ASSERT_NE(nullptr, performance_handle); - zes_perf_properties_t perfProperties = {}; - perfProperties = lzt::get_performance_properties(performance_handle); - if (perfProperties.engines & ZES_ENGINE_TYPE_FLAG_MEDIA) { - auto initialFactor = lzt::get_performance_config(performance_handle); - // Verify that performance factor is equal to 50 if value set is 1-50 - // and equal to 100 if value set is 51-100 - // value 25 - double pFactor = set_performance_factor(performance_handle, 25); - EXPECT_EQ(pFactor, 50); - // value 49 - pFactor = set_performance_factor(performance_handle, 49); - EXPECT_EQ(pFactor, 50); - // value 50 - pFactor = set_performance_factor(performance_handle, 50); - EXPECT_EQ(pFactor, 50); - // value 51 - pFactor = set_performance_factor(performance_handle, 51); - EXPECT_EQ(pFactor, 100); - // value 75 - pFactor = set_performance_factor(performance_handle, 75); - EXPECT_EQ(pFactor, 100); - // value 99 - pFactor = set_performance_factor(performance_handle, 99); - EXPECT_EQ(pFactor, 100); - // value 100 - pFactor = set_performance_factor(performance_handle, 100); - EXPECT_EQ(pFactor, 100); - lzt::set_performance_config(performance_handle, initialFactor); + count = lzt::get_performance_handle_count(device); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + auto performance_handles = lzt::get_performance_handles(device, count); + for (auto performance_handle : performance_handles) { + ASSERT_NE(nullptr, performance_handle); + zes_perf_properties_t perfProperties = {}; + perfProperties = lzt::get_performance_properties(performance_handle); + if (perfProperties.engines & ZES_ENGINE_TYPE_FLAG_MEDIA) { + auto initialFactor = lzt::get_performance_config(performance_handle); + // Verify that performance factor is equal to 50 if value set is 1-50 + // and equal to 100 if value set is 51-100 + // value 25 + double pFactor = set_performance_factor(performance_handle, 25); + EXPECT_EQ(pFactor, 50); + // value 49 + pFactor = set_performance_factor(performance_handle, 49); + EXPECT_EQ(pFactor, 50); + // value 50 + pFactor = set_performance_factor(performance_handle, 50); + EXPECT_EQ(pFactor, 50); + // value 51 + pFactor = set_performance_factor(performance_handle, 51); + EXPECT_EQ(pFactor, 100); + // value 75 + pFactor = set_performance_factor(performance_handle, 75); + EXPECT_EQ(pFactor, 100); + // value 99 + pFactor = set_performance_factor(performance_handle, 99); + EXPECT_EQ(pFactor, 100); + // value 100 + pFactor = set_performance_factor(performance_handle, 100); + EXPECT_EQ(pFactor, 100); + lzt::set_performance_config(performance_handle, initialFactor); + } } + } else { + LOG_INFO << "No performance handles found for this device! "; } } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; + } } LZT_TEST_F( @@ -234,31 +279,42 @@ LZT_TEST_F( GivenValidPerformanceHandleWhenGettingPerformanceConfigurationThenValidPerformanceFactorIsReturned) { for (auto device : devices) { uint32_t count = 0; - auto performance_handles = lzt::get_performance_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto performance_handle : performance_handles) { - ASSERT_NE(nullptr, performance_handle); - auto getFactor = lzt::get_performance_config(performance_handle); - EXPECT_GE(getFactor, 0); - EXPECT_LE(getFactor, 100); + count = lzt::get_performance_handle_count(device); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + auto performance_handles = lzt::get_performance_handles(device, count); + for (auto performance_handle : performance_handles) { + ASSERT_NE(nullptr, performance_handle); + auto getFactor = lzt::get_performance_config(performance_handle); + EXPECT_GE(getFactor, 0); + EXPECT_LE(getFactor, 100); + } + } else { + LOG_INFO << "No performance handles found for this device! "; } } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; + } } #ifdef USE_ZESINIT class PerformanceModuleParamComputePerformanceFactorZesTest : public lzt::ZesSysmanCtsClass, - public ::testing::WithParamInterface {}; + public ::testing::WithParamInterface { +public: + bool is_performance_supported = false; +}; #define PERFORMANCE_COMPUTE_TEST \ PerformanceModuleParamComputePerformanceFactorZesTest #else // USE_ZESINIT class PerformanceModuleParamComputePerformanceFactorTest : public lzt::SysmanCtsClass, - public ::testing::WithParamInterface {}; + public ::testing::WithParamInterface { +public: + bool is_performance_supported = false; +}; #define PERFORMANCE_COMPUTE_TEST \ PerformanceModuleParamComputePerformanceFactorTest #endif // USE_ZESINIT @@ -268,25 +324,31 @@ LZT_TEST_P( GivenValidPerformanceHandleWhenSettingMultiplePerformanceFactorForComputeThenValidPerformanceFactorIsReturned) { for (auto device : devices) { uint32_t count = 0; - auto performance_handles = lzt::get_performance_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - for (auto performance_handle : performance_handles) { - ASSERT_NE(nullptr, performance_handle); - zes_perf_properties_t perfProperties = {}; - perfProperties = lzt::get_performance_properties(performance_handle); - if (perfProperties.engines & ZES_ENGINE_TYPE_FLAG_COMPUTE) { - auto initialFactor = lzt::get_performance_config(performance_handle); - double input_pfactor = static_cast(GetParam()); - double pFactor = - set_performance_factor(performance_handle, input_pfactor); - EXPECT_EQ(std::round(pFactor), input_pfactor); - lzt::set_performance_config(performance_handle, initialFactor); + count = lzt::get_performance_handle_count(device); + if (count > 0) { + is_performance_supported = true; + LOG_INFO << "Performance handles are available on this device! "; + auto performance_handles = lzt::get_performance_handles(device, count); + for (auto performance_handle : performance_handles) { + ASSERT_NE(nullptr, performance_handle); + zes_perf_properties_t perfProperties = {}; + perfProperties = lzt::get_performance_properties(performance_handle); + if (perfProperties.engines & ZES_ENGINE_TYPE_FLAG_COMPUTE) { + auto initialFactor = lzt::get_performance_config(performance_handle); + double input_pfactor = static_cast(GetParam()); + double pFactor = + set_performance_factor(performance_handle, input_pfactor); + EXPECT_EQ(std::round(pFactor), input_pfactor); + lzt::set_performance_config(performance_handle, initialFactor); + } } + } else { + LOG_INFO << "No performance handles found for this device! "; } } + if (!is_performance_supported) { + FAIL() << "No performance handles found on any of the devices! "; + } } INSTANTIATE_TEST_CASE_P(TestCasesforComputePerformanceFactorVerification, diff --git a/conformance_tests/sysman/test_sysman_power/src/test_sysman_power.cpp b/conformance_tests/sysman/test_sysman_power/src/test_sysman_power.cpp index 711e8636..0612cee0 100644 --- a/conformance_tests/sysman/test_sysman_power/src/test_sysman_power.cpp +++ b/conformance_tests/sysman/test_sysman_power/src/test_sysman_power.cpp @@ -1021,6 +1021,7 @@ LZT_TEST_F( continue; } EXPECT_ZE_RESULT_SUCCESS(status); + int32_t max_power_limit_first = std::numeric_limits::max(); for (int i = 0; i < power_limits_descriptors.size(); i++) { zes_power_limit_ext_desc_t power_peak_initial = {}; zes_power_limit_ext_desc_t power_peak_Max = {}; @@ -1031,8 +1032,11 @@ LZT_TEST_F( zes_power_source_t power_source = power_limits_descriptors[i].source; power_peak_Max = power_limits_descriptors[i]; power_peak_initial = power_limits_descriptors[i]; - power_peak_Max.limit = std::numeric_limits::max(); - power_peak_initial.limit *= 2; + power_peak_Max.limit = max_power_limit_first; + + int32_t max_power_limit_second = + power_limits_descriptors[i].limit * 2; + power_peak_initial.limit = max_power_limit_second; if (power_limits_descriptors[i].limitValueLocked == false) { status = lzt::set_power_limits_ext(p_power_handle, &single_count, @@ -1054,6 +1058,7 @@ LZT_TEST_F( if (p_power_limits_descriptor_get.level == ZES_POWER_LEVEL_PEAK && p_power_limits_descriptor_get.source == power_source) { power_peak_getMax = p_power_limits_descriptor_get; + EXPECT_LT(power_peak_getMax.limit, max_power_limit_first); } } @@ -1076,9 +1081,9 @@ LZT_TEST_F( if (p_power_limits_descriptor_get.level == ZES_POWER_LEVEL_PEAK && p_power_limits_descriptor_get.source == power_source) { power_peak_get = p_power_limits_descriptor_get; + EXPECT_LE(power_peak_get.limit, max_power_limit_second); } } - EXPECT_LE(power_peak_get.limit, power_peak_getMax.limit); } else { LOG_INFO << "Set limit not supported due to peak " "limitValueLocked flag is true"; diff --git a/conformance_tests/sysman/test_sysman_scheduler/src/test_sysman_scheduler.cpp b/conformance_tests/sysman/test_sysman_scheduler/src/test_sysman_scheduler.cpp index 936103c0..c0416189 100644 --- a/conformance_tests/sysman/test_sysman_scheduler/src/test_sysman_scheduler.cpp +++ b/conformance_tests/sysman/test_sysman_scheduler/src/test_sysman_scheduler.cpp @@ -19,10 +19,16 @@ namespace lzt = level_zero_tests; namespace { #ifdef USE_ZESINIT -class SchedulerZesTest : public lzt::ZesSysmanCtsClass {}; +class SchedulerZesTest : public lzt::ZesSysmanCtsClass { +public: + bool is_scheduler_supported = false; +}; #define SCHEDULER_TEST SchedulerZesTest #else // USE_ZESINIT -class SchedulerTest : public lzt::SysmanCtsClass {}; +class SchedulerTest : public lzt::SysmanCtsClass { +public: + bool is_scheduler_supported = false; +}; #define SCHEDULER_TEST SchedulerTest #endif // USE_ZESINIT @@ -32,11 +38,16 @@ LZT_TEST_F( for (auto device : devices) { uint32_t count = 0; count = lzt::get_scheduler_handle_count(device); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + if (count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( @@ -44,16 +55,21 @@ LZT_TEST_F( GivenComponentCountZeroWhenRetrievingSchedulerHandlesThenNotNullSchedulerHandlesAreReturned) { for (auto device : devices) { uint32_t count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); + count = lzt::get_scheduler_handle_count(device); + if (count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( @@ -61,15 +77,20 @@ LZT_TEST_F( GivenComponentCountWhenRetrievingSchedulerHandlesThenActualComponentCountIsUpdated) { for (auto device : devices) { uint32_t p_count = 0; - lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + lzt::get_scheduler_handles(device, p_count); + uint32_t test_count = p_count + 1; + lzt::get_scheduler_handles(device, test_count); + EXPECT_EQ(test_count, p_count); + } else { + LOG_INFO << "No scheduler handles found for this device! "; } - - uint32_t test_count = p_count + 1; - lzt::get_scheduler_handles(device, test_count); - EXPECT_EQ(test_count, p_count); + } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; } } @@ -78,21 +99,26 @@ LZT_TEST_F( GivenValidComponentCountWhenCallingApiTwiceThenSimilarSchedulerHandlesReturned) { for (auto device : devices) { uint32_t count = 0; - auto p_sched_handles_initial = lzt::get_scheduler_handles(device, count); - if (count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles_initial) { - EXPECT_NE(nullptr, p_sched_handle); - } - count = 0; - auto p_sched_handles_later = lzt::get_scheduler_handles(device, count); - for (auto p_sched_handle : p_sched_handles_later) { - EXPECT_NE(nullptr, p_sched_handle); + count = lzt::get_scheduler_handle_count(device); + if (count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles_initial = lzt::get_scheduler_handles(device, count); + for (auto p_sched_handle : p_sched_handles_initial) { + EXPECT_NE(nullptr, p_sched_handle); + } + count = 0; + auto p_sched_handles_later = lzt::get_scheduler_handles(device, count); + for (auto p_sched_handle : p_sched_handles_later) { + EXPECT_NE(nullptr, p_sched_handle); + } + EXPECT_EQ(p_sched_handles_initial, p_sched_handles_later); + } else { + LOG_INFO << "No scheduler handles found for this device! "; } - EXPECT_EQ(p_sched_handles_initial, p_sched_handles_later); + } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; } } @@ -101,38 +127,48 @@ LZT_TEST_F( GivenValidSchedulerHandleWhenRetrievinCurrentModeThenSuccessIsReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); - ASSERT_GE(cur_mode, ZES_SCHED_MODE_TIMEOUT); - ASSERT_LE(cur_mode, ZES_SCHED_MODE_COMPUTE_UNIT_DEBUG); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); + ASSERT_GE(cur_mode, ZES_SCHED_MODE_TIMEOUT); + ASSERT_LE(cur_mode, ZES_SCHED_MODE_COMPUTE_UNIT_DEBUG); + } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( SCHEDULER_TEST, GivenValidSchedulerHandleWhenRetrievingCurrentModeTwiceThenSameModeIsReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto cur_mode_initial = lzt::get_scheduler_current_mode(p_sched_handle); - auto cur_mode_later = lzt::get_scheduler_current_mode(p_sched_handle); - EXPECT_EQ(cur_mode_initial, cur_mode_later); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto cur_mode_initial = lzt::get_scheduler_current_mode(p_sched_handle); + auto cur_mode_later = lzt::get_scheduler_current_mode(p_sched_handle); + EXPECT_EQ(cur_mode_initial, cur_mode_later); + } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( @@ -140,129 +176,152 @@ LZT_TEST_F( GivenValidSchedulerHandleWhenRetrievingSchedulerTimeOutPropertiesThenSuccessIsReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); - if (cur_mode == ZES_SCHED_MODE_TIMEOUT) { - auto timeout_properties = - lzt::get_timeout_properties(p_sched_handle, false); - EXPECT_GT(timeout_properties.watchdogTimeout, 0); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); + if (cur_mode == ZES_SCHED_MODE_TIMEOUT) { + auto timeout_properties = + lzt::get_timeout_properties(p_sched_handle, false); + EXPECT_GT(timeout_properties.watchdogTimeout, 0); + } } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( SCHEDULER_TEST, GivenValidSchedulerHandleWhenRetrievingSchedulerTimeOutPropertiesTwiceThenSamePropertiesAreReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); - if (cur_mode == ZES_SCHED_MODE_TIMEOUT) { - auto timeout_properties_initial = - lzt::get_timeout_properties(p_sched_handle, false); - auto timeout_properties_later = - lzt::get_timeout_properties(p_sched_handle, false); - EXPECT_EQ(timeout_properties_initial.watchdogTimeout, - timeout_properties_later.watchdogTimeout); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); + if (cur_mode == ZES_SCHED_MODE_TIMEOUT) { + auto timeout_properties_initial = + lzt::get_timeout_properties(p_sched_handle, false); + auto timeout_properties_later = + lzt::get_timeout_properties(p_sched_handle, false); + EXPECT_EQ(timeout_properties_initial.watchdogTimeout, + timeout_properties_later.watchdogTimeout); + } } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( SCHEDULER_TEST, GivenValidSchedulerHandleWhenRetrievingSchedulerTimeSlicePropertiesThenSuccessIsReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); - if (cur_mode == ZES_SCHED_MODE_TIMESLICE) { - auto timeslice_properties = - lzt::get_timeslice_properties(p_sched_handle, false); - EXPECT_GT(timeslice_properties.interval, 0); - EXPECT_GE(timeslice_properties.yieldTimeout, 0); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); + if (cur_mode == ZES_SCHED_MODE_TIMESLICE) { + auto timeslice_properties = + lzt::get_timeslice_properties(p_sched_handle, false); + EXPECT_GT(timeslice_properties.interval, 0); + EXPECT_GE(timeslice_properties.yieldTimeout, 0); + } } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( SCHEDULER_TEST, GivenValidSchedulerHandleWhenRetrievingSchedulerTimeSlicePropertiesTwiceThenSamePropertiesAreReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); - if (cur_mode == ZES_SCHED_MODE_TIMESLICE) { - auto timeslice_properties_initial = - lzt::get_timeslice_properties(p_sched_handle, false); - auto timeslice_properties_later = - lzt::get_timeslice_properties(p_sched_handle, false); - EXPECT_EQ(timeslice_properties_initial.interval, - timeslice_properties_later.interval); - EXPECT_EQ(timeslice_properties_initial.yieldTimeout, - timeslice_properties_later.yieldTimeout); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); + if (cur_mode == ZES_SCHED_MODE_TIMESLICE) { + auto timeslice_properties_initial = + lzt::get_timeslice_properties(p_sched_handle, false); + auto timeslice_properties_later = + lzt::get_timeslice_properties(p_sched_handle, false); + EXPECT_EQ(timeslice_properties_initial.interval, + timeslice_properties_later.interval); + EXPECT_EQ(timeslice_properties_initial.yieldTimeout, + timeslice_properties_later.yieldTimeout); + } } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( SCHEDULER_TEST, GivenValidSchedulerHandleWhenSettingSchedulerTimeOutModeThenSuccessIsReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto timeout_pretest_properties = - lzt::get_timeout_properties(p_sched_handle, false); - - zes_sched_timeout_properties_t timeout_set_properties = { - ZES_STRUCTURE_TYPE_SCHED_TIMEOUT_PROPERTIES, nullptr}; - uint64_t watchdogTimeoutTestValue = 50000; - timeout_set_properties.watchdogTimeout = watchdogTimeoutTestValue; - lzt::set_timeout_mode(p_sched_handle, timeout_set_properties); - auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); - ASSERT_EQ(cur_mode, ZES_SCHED_MODE_TIMEOUT); - auto timeout_get_properties = - lzt::get_timeout_properties(p_sched_handle, false); - EXPECT_EQ(timeout_get_properties.watchdogTimeout, - timeout_set_properties.watchdogTimeout); - - lzt::set_timeout_mode(p_sched_handle, timeout_pretest_properties); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto timeout_pretest_properties = + lzt::get_timeout_properties(p_sched_handle, false); + zes_sched_timeout_properties_t timeout_set_properties = { + ZES_STRUCTURE_TYPE_SCHED_TIMEOUT_PROPERTIES, nullptr}; + uint64_t watchdogTimeoutTestValue = 50000; + timeout_set_properties.watchdogTimeout = watchdogTimeoutTestValue; + lzt::set_timeout_mode(p_sched_handle, timeout_set_properties); + auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); + ASSERT_EQ(cur_mode, ZES_SCHED_MODE_TIMEOUT); + auto timeout_get_properties = + lzt::get_timeout_properties(p_sched_handle, false); + EXPECT_EQ(timeout_get_properties.watchdogTimeout, + timeout_set_properties.watchdogTimeout); + lzt::set_timeout_mode(p_sched_handle, timeout_pretest_properties); + } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( @@ -270,62 +329,71 @@ LZT_TEST_F( GivenValidSchedulerHandleWhenSettingSchedulerTimeSliceModeThenSuccessIsReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto timeslice_default_properties = - lzt::get_timeslice_properties(p_sched_handle, true); - zes_sched_timeslice_properties_t timeslice_set_properties = { - ZES_STRUCTURE_TYPE_SCHED_TIMESLICE_PROPERTIES, nullptr}; - timeslice_set_properties.interval = timeslice_default_properties.interval; - timeslice_set_properties.yieldTimeout = - timeslice_default_properties.yieldTimeout; - lzt::set_timeslice_mode(p_sched_handle, timeslice_set_properties); - auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); - ASSERT_EQ(cur_mode, ZES_SCHED_MODE_TIMESLICE); - auto timeslice_get_properties = - lzt::get_timeslice_properties(p_sched_handle, false); - EXPECT_EQ(timeslice_get_properties.interval, - timeslice_set_properties.interval); - EXPECT_EQ(timeslice_get_properties.yieldTimeout, - timeslice_set_properties.yieldTimeout); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto timeslice_default_properties = + lzt::get_timeslice_properties(p_sched_handle, true); + zes_sched_timeslice_properties_t timeslice_set_properties = { + ZES_STRUCTURE_TYPE_SCHED_TIMESLICE_PROPERTIES, nullptr}; + timeslice_set_properties.interval = + timeslice_default_properties.interval; + timeslice_set_properties.yieldTimeout = + timeslice_default_properties.yieldTimeout; + lzt::set_timeslice_mode(p_sched_handle, timeslice_set_properties); + auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); + ASSERT_EQ(cur_mode, ZES_SCHED_MODE_TIMESLICE); + auto timeslice_get_properties = + lzt::get_timeslice_properties(p_sched_handle, false); + EXPECT_EQ(timeslice_get_properties.interval, + timeslice_set_properties.interval); + EXPECT_EQ(timeslice_get_properties.yieldTimeout, + timeslice_set_properties.yieldTimeout); + } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( SCHEDULER_TEST, GivenValidSchedulerHandleWhenSettingSchedulerExclusiveModeThenSuccesseReturned) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); - if (cur_mode != ZES_SCHED_MODE_EXCLUSIVE) { - auto timeout_pretest_properties = - lzt::get_timeout_properties(p_sched_handle, false); - auto timeslice_pretest_properties = - lzt::get_timeslice_properties(p_sched_handle, false); - - lzt::set_exclusive_mode(p_sched_handle); - auto mode = lzt::get_scheduler_current_mode(p_sched_handle); - ASSERT_EQ(mode, ZES_SCHED_MODE_EXCLUSIVE); - - lzt::set_timeout_mode(p_sched_handle, timeout_pretest_properties); - lzt::set_timeslice_mode(p_sched_handle, timeslice_pretest_properties); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto cur_mode = lzt::get_scheduler_current_mode(p_sched_handle); + if (cur_mode != ZES_SCHED_MODE_EXCLUSIVE) { + auto timeout_pretest_properties = + lzt::get_timeout_properties(p_sched_handle, false); + auto timeslice_pretest_properties = + lzt::get_timeslice_properties(p_sched_handle, false); + lzt::set_exclusive_mode(p_sched_handle); + auto mode = lzt::get_scheduler_current_mode(p_sched_handle); + ASSERT_EQ(mode, ZES_SCHED_MODE_EXCLUSIVE); + lzt::set_timeout_mode(p_sched_handle, timeout_pretest_properties); + lzt::set_timeslice_mode(p_sched_handle, timeslice_pretest_properties); + } } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( @@ -334,25 +402,30 @@ LZT_TEST_F( for (auto device : devices) { auto deviceProperties = lzt::get_sysman_device_properties(device); uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - ASSERT_NE(nullptr, p_sched_handle); - auto properties = lzt::get_scheduler_properties(p_sched_handle); - EXPECT_GE(properties.engines, ZES_ENGINE_TYPE_FLAG_OTHER); - EXPECT_LE(properties.engines, ZES_ENGINE_TYPE_FLAG_RENDER); - EXPECT_GE(properties.supportedModes, 1); - EXPECT_LE(properties.supportedModes, - (1 << ZES_SCHED_MODE_COMPUTE_UNIT_DEBUG)); - if (properties.onSubdevice) { - EXPECT_LT(properties.subdeviceId, deviceProperties.numSubdevices); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + ASSERT_NE(nullptr, p_sched_handle); + auto properties = lzt::get_scheduler_properties(p_sched_handle); + EXPECT_GE(properties.engines, ZES_ENGINE_TYPE_FLAG_OTHER); + EXPECT_LE(properties.engines, ZES_ENGINE_TYPE_FLAG_RENDER); + EXPECT_GE(properties.supportedModes, 1); + EXPECT_LE(properties.supportedModes, + (1 << ZES_SCHED_MODE_COMPUTE_UNIT_DEBUG)); + if (properties.onSubdevice) { + EXPECT_LT(properties.subdeviceId, deviceProperties.numSubdevices); + } } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } LZT_TEST_F( @@ -360,26 +433,32 @@ LZT_TEST_F( GivenValidSchedulerHandleWhenRetrievingSchedulerPropertiesThenExpectSamePropertiesReturnedTwice) { for (auto device : devices) { uint32_t p_count = 0; - auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); - if (p_count == 0) { - FAIL() << "No handles found: " - << _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } - - for (auto p_sched_handle : p_sched_handles) { - EXPECT_NE(nullptr, p_sched_handle); - auto properties_initial = lzt::get_scheduler_properties(p_sched_handle); - auto properties_later = lzt::get_scheduler_properties(p_sched_handle); - EXPECT_EQ(properties_initial.engines, properties_later.engines); - EXPECT_EQ(properties_initial.supportedModes, - properties_later.supportedModes); - EXPECT_EQ(properties_initial.canControl, properties_later.canControl); - EXPECT_EQ(properties_initial.onSubdevice, properties_later.onSubdevice); - if (properties_initial.onSubdevice && properties_later.onSubdevice) { - EXPECT_EQ(properties_initial.subdeviceId, properties_later.subdeviceId); + p_count = lzt::get_scheduler_handle_count(device); + if (p_count > 0) { + is_scheduler_supported = true; + LOG_INFO << "Scheduler handles are available on this device! "; + auto p_sched_handles = lzt::get_scheduler_handles(device, p_count); + for (auto p_sched_handle : p_sched_handles) { + EXPECT_NE(nullptr, p_sched_handle); + auto properties_initial = lzt::get_scheduler_properties(p_sched_handle); + auto properties_later = lzt::get_scheduler_properties(p_sched_handle); + EXPECT_EQ(properties_initial.engines, properties_later.engines); + EXPECT_EQ(properties_initial.supportedModes, + properties_later.supportedModes); + EXPECT_EQ(properties_initial.canControl, properties_later.canControl); + EXPECT_EQ(properties_initial.onSubdevice, properties_later.onSubdevice); + if (properties_initial.onSubdevice && properties_later.onSubdevice) { + EXPECT_EQ(properties_initial.subdeviceId, + properties_later.subdeviceId); + } } + } else { + LOG_INFO << "No scheduler handles found for this device! "; } } + if (!is_scheduler_supported) { + FAIL() << "No scheduler handles found on any of the devices! "; + } } } // namespace