diff --git a/src/bindings/c/include/openvino/c/ov_property.h b/src/bindings/c/include/openvino/c/ov_property.h index 63146c7f48e..743233df8fe 100644 --- a/src/bindings/c/include/openvino/c/ov_property.h +++ b/src/bindings/c/include/openvino/c/ov_property.h @@ -133,6 +133,13 @@ ov_property_key_hint_use_hyper_threading; OPENVINO_C_VAR(const char*) ov_property_key_hint_performance_mode; +/** + * @brief Read-write property, it is high-level OpenVINO Hints for the type of CPU core used during inference + * @ingroup ov_property_c_api + */ +OPENVINO_C_VAR(const char*) +ov_property_key_hint_scheduling_core_type; + /** * @brief Read-write property to set the hint for device to use specified precision for inference. * @ingroup ov_property_c_api diff --git a/src/bindings/c/src/ov_property.cpp b/src/bindings/c/src/ov_property.cpp index 1fe6e9397e2..1506d94c1f1 100644 --- a/src/bindings/c/src/ov_property.cpp +++ b/src/bindings/c/src/ov_property.cpp @@ -23,6 +23,7 @@ const char* ov_property_key_num_streams = "NUM_STREAMS"; const char* ov_property_key_affinity = "AFFINITY"; const char* ov_property_key_inference_num_threads = "INFERENCE_NUM_THREADS"; const char* ov_property_key_hint_performance_mode = "PERFORMANCE_HINT"; +const char* ov_property_key_hint_scheduling_core_type = "SCHEDULING_CORE_TYPE"; const char* ov_property_key_hint_use_hyper_threading = "USE_HYPER_THREADING"; const char* ov_property_key_hint_inference_precision = "INFERENCE_PRECISION_HINT"; const char* ov_property_key_hint_num_requests = "PERFORMANCE_HINT_NUM_REQUESTS"; diff --git a/src/bindings/c/tests/ov_core_test.cpp b/src/bindings/c/tests/ov_core_test.cpp index 8fe3f41d9cc..20e116cd7b7 100644 --- a/src/bindings/c/tests/ov_core_test.cpp +++ b/src/bindings/c/tests/ov_core_test.cpp @@ -260,6 +260,19 @@ TEST_P(ov_core_test, ov_core_set_property_enum_invalid) { EXPECT_STRNE(invalid_mode, ret); ov_free(ret); + const char* key_type = ov_property_key_hint_scheduling_core_type; + const char* val_type = "PCORE_ONLY"; + OV_EXPECT_OK(ov_core_set_property(core, device_name.c_str(), key_type, val_type)); + ret = nullptr; + OV_EXPECT_OK(ov_core_get_property(core, device_name.c_str(), key_type, &ret)); + EXPECT_STREQ(val_type, ret); + ov_free(ret); + + const char* invalid_val = "INVALID_VAL"; + OV_EXPECT_NOT_OK(ov_core_set_property(core, device_name.c_str(), key_type, invalid_val)); + ret = nullptr; + OV_EXPECT_OK(ov_core_get_property(core, device_name.c_str(), key_type, &ret)); + const char* key_ht = ov_property_key_hint_use_hyper_threading; const char* val_ht = "YES"; OV_EXPECT_OK(ov_core_set_property(core, device_name.c_str(), key_ht, val_ht)); @@ -268,10 +281,10 @@ TEST_P(ov_core_test, ov_core_set_property_enum_invalid) { EXPECT_STREQ(val_ht, ret); ov_free(ret); - const char* invalid_val = "INVALID_VAL"; OV_EXPECT_NOT_OK(ov_core_set_property(core, device_name.c_str(), key_ht, invalid_val)); ret = nullptr; OV_EXPECT_OK(ov_core_get_property(core, device_name.c_str(), key_ht, &ret)); + EXPECT_STRNE(invalid_val, ret); ov_free(ret); @@ -292,12 +305,20 @@ TEST_P(ov_core_test, ov_core_set_and_get_property_enum) { EXPECT_STREQ(affinity, ret); ov_free(ret); + const char* key_type = ov_property_key_hint_scheduling_core_type; + const char* val_type = "PCORE_ONLY"; + OV_EXPECT_OK(ov_core_set_property(core, device_name.c_str(), key_type, val_type)); + ret = nullptr; + OV_EXPECT_OK(ov_core_get_property(core, device_name.c_str(), key_type, &ret)); + EXPECT_STREQ(val_type, ret); + const char* key_ht = ov_property_key_hint_use_hyper_threading; const char* val_ht = "YES"; OV_EXPECT_OK(ov_core_set_property(core, device_name.c_str(), key_ht, val_ht)); ret = nullptr; OV_EXPECT_OK(ov_core_get_property(core, device_name.c_str(), key_ht, &ret)); EXPECT_STREQ(val_ht, ret); + ov_free(ret); ov_core_free(core); diff --git a/src/bindings/python/src/pyopenvino/core/properties/properties.cpp b/src/bindings/python/src/pyopenvino/core/properties/properties.cpp index da9e4e0af51..3bc97410508 100644 --- a/src/bindings/python/src/pyopenvino/core/properties/properties.cpp +++ b/src/bindings/python/src/pyopenvino/core/properties/properties.cpp @@ -58,6 +58,11 @@ void regmodule_properties(py::module m) { .value("THROUGHPUT", ov::hint::PerformanceMode::THROUGHPUT) .value("CUMULATIVE_THROUGHPUT", ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT); + py::enum_(m_hint, "SchedulingCoreType", py::arithmetic()) + .value("ANY_CORE", ov::hint::SchedulingCoreType::ANY_CORE) + .value("PCORE_ONLY", ov::hint::SchedulingCoreType::PCORE_ONLY) + .value("ECORE_ONLY", ov::hint::SchedulingCoreType::ECORE_ONLY); + py::enum_(m_hint, "ExecutionMode", py::arithmetic()) .value("UNDEFINED", ov::hint::ExecutionMode::UNDEFINED) .value("PERFORMANCE", ov::hint::ExecutionMode::PERFORMANCE) @@ -67,6 +72,7 @@ void regmodule_properties(py::module m) { wrap_property_RW(m_hint, ov::hint::inference_precision, "inference_precision"); wrap_property_RW(m_hint, ov::hint::model_priority, "model_priority"); wrap_property_RW(m_hint, ov::hint::performance_mode, "performance_mode"); + wrap_property_RW(m_hint, ov::hint::scheduling_core_type, "scheduling_core_type"); wrap_property_RW(m_hint, ov::hint::use_hyper_threading, "use_hyper_threading"); wrap_property_RW(m_hint, ov::hint::execution_mode, "execution_mode"); wrap_property_RW(m_hint, ov::hint::num_requests, "num_requests"); diff --git a/src/bindings/python/src/pyopenvino/utils/utils.cpp b/src/bindings/python/src/pyopenvino/utils/utils.cpp index 12f08410a67..297196a7197 100644 --- a/src/bindings/python/src/pyopenvino/utils/utils.cpp +++ b/src/bindings/python/src/pyopenvino/utils/utils.cpp @@ -171,6 +171,8 @@ py::object from_ov_any(const ov::Any& any) { return py::cast(any.as()); } else if (any.is()) { return py::cast(any.as()); + } else if (any.is()) { + return py::cast(any.as()); } else if (any.is()) { return py::cast(any.as()); } else if (any.is()) { @@ -336,6 +338,8 @@ ov::Any py_object_to_any(const py::object& py_obj) { return py::cast(py_obj); } else if (py::isinstance(py_obj)) { return py::cast(py_obj); + } else if (py::isinstance(py_obj)) { + return py::cast(py_obj); } else if (py::isinstance(py_obj)) { return py::cast(py_obj); } else if (py::isinstance(py_obj)) { diff --git a/src/bindings/python/tests/test_runtime/test_properties.py b/src/bindings/python/tests/test_runtime/test_properties.py index 6eecdfb090b..f525ed23e11 100644 --- a/src/bindings/python/tests/test_runtime/test_properties.py +++ b/src/bindings/python/tests/test_runtime/test_properties.py @@ -60,6 +60,14 @@ def test_properties_rw_base(): (properties.hint.PerformanceMode.CUMULATIVE_THROUGHPUT, "PerformanceMode.CUMULATIVE_THROUGHPUT", 3), ), ), + ( + properties.hint.SchedulingCoreType, + ( + (properties.hint.SchedulingCoreType.ANY_CORE, "SchedulingCoreType.ANY_CORE", 0), + (properties.hint.SchedulingCoreType.PCORE_ONLY, "SchedulingCoreType.PCORE_ONLY", 1), + (properties.hint.SchedulingCoreType.ECORE_ONLY, "SchedulingCoreType.ECORE_ONLY", 2), + ), + ), ( properties.hint.ExecutionMode, ( @@ -219,6 +227,11 @@ def test_properties_ro(ov_property_ro, expected_value): "PERFORMANCE_HINT", ((properties.hint.PerformanceMode.UNDEFINED, properties.hint.PerformanceMode.UNDEFINED),), ), + ( + properties.hint.scheduling_core_type, + "SCHEDULING_CORE_TYPE", + ((properties.hint.SchedulingCoreType.PCORE_ONLY, properties.hint.SchedulingCoreType.PCORE_ONLY),), + ), ( properties.hint.use_hyper_threading, "USE_HYPER_THREADING", @@ -409,6 +422,7 @@ def test_single_property_setting(device): properties.affinity(properties.Affinity.NONE), properties.inference_precision(Type.f32), properties.hint.performance_mode(properties.hint.PerformanceMode.LATENCY), + properties.hint.scheduling_core_type(properties.hint.SchedulingCoreType.PCORE_ONLY), properties.hint.use_hyper_threading(True), properties.hint.num_requests(12), properties.streams.num(5), @@ -422,6 +436,7 @@ def test_single_property_setting(device): properties.affinity(): properties.Affinity.NONE, properties.inference_precision(): Type.f32, properties.hint.performance_mode(): properties.hint.PerformanceMode.LATENCY, + properties.hint.scheduling_core_type(): properties.hint.SchedulingCoreType.PCORE_ONLY, properties.hint.use_hyper_threading(): True, properties.hint.num_requests(): 12, properties.streams.num(): 5, @@ -434,6 +449,7 @@ def test_single_property_setting(device): properties.affinity(): "NONE", "INFERENCE_PRECISION_HINT": Type.f32, properties.hint.performance_mode(): properties.hint.PerformanceMode.LATENCY, + properties.hint.scheduling_core_type(): properties.hint.SchedulingCoreType.PCORE_ONLY, properties.hint.num_requests(): 12, "NUM_STREAMS": properties.streams.Num(5), }, diff --git a/src/inference/dev_api/openvino/runtime/threading/cpu_map_scheduling.hpp b/src/inference/dev_api/openvino/runtime/threading/cpu_map_scheduling.hpp index d00929bfe24..db13f57fe76 100644 --- a/src/inference/dev_api/openvino/runtime/threading/cpu_map_scheduling.hpp +++ b/src/inference/dev_api/openvino/runtime/threading/cpu_map_scheduling.hpp @@ -15,6 +15,15 @@ namespace ov { +/** + * @brief Limit available CPU resource in processors type table according to scheduling core type property + * @param[in] input_type input value of core type property. + * @param[in] proc_type_table candidate processors available at this time + * @return updated proc_type_table which removed unmatched processors + */ +std::vector> apply_scheduling_core_type(const ov::hint::SchedulingCoreType input_type, + const std::vector>& proc_type_table); + /** * @brief Limit available CPU resource in processors type table according to hyper threading property * @param[in] input_type indicate value of property use_hyper_threading. @@ -24,6 +33,6 @@ namespace ov { */ std::vector> apply_hyper_threading(bool input_type, const bool input_changed, - const std::vector> proc_type_table); + const std::vector>& proc_type_table); } // namespace ov \ No newline at end of file diff --git a/src/inference/include/openvino/runtime/properties.hpp b/src/inference/include/openvino/runtime/properties.hpp index 5b567394144..bff6714cbd5 100644 --- a/src/inference/include/openvino/runtime/properties.hpp +++ b/src/inference/include/openvino/runtime/properties.hpp @@ -351,6 +351,62 @@ inline std::istream& operator>>(std::istream& is, PerformanceMode& performance_m */ static constexpr Property performance_mode{"PERFORMANCE_HINT"}; +/** + * @enum SchedulingCoreType + * @brief This enum contains definition of core type can be used for CPU tasks on different devices. + */ +enum class SchedulingCoreType { + ANY_CORE = 0, //!< Any processors can be used. + PCORE_ONLY = 1, //!< Only processors of performance-cores can be used. + ECORE_ONLY = 2, //!< Only processors of efficient-cores can be used. +}; + +/** @cond INTERNAL */ +inline std::ostream& operator<<(std::ostream& os, const SchedulingCoreType& core_type) { + switch (core_type) { + case SchedulingCoreType::ANY_CORE: + return os << "ANY_CORE"; + case SchedulingCoreType::PCORE_ONLY: + return os << "PCORE_ONLY"; + case SchedulingCoreType::ECORE_ONLY: + return os << "ECORE_ONLY"; + default: + throw ov::Exception{"Unsupported core type!"}; + } +} + +inline std::istream& operator>>(std::istream& is, SchedulingCoreType& core_type) { + std::string str; + is >> str; + if (str == "ANY_CORE") { + core_type = SchedulingCoreType::ANY_CORE; + } else if (str == "PCORE_ONLY") { + core_type = SchedulingCoreType::PCORE_ONLY; + } else if (str == "ECORE_ONLY") { + core_type = SchedulingCoreType::ECORE_ONLY; + } else { + throw ov::Exception{"Unsupported core type: " + str}; + } + return is; +} +/** @endcond */ + +/** + * @brief This property defines CPU core type which can be used during inference. + * @ingroup ov_runtime_cpp_prop_api + * + * Developer can use this property to select specific CPU cores for inference. Please refer SchedulingCoreType for + * all definition of core type. + * + * The following code is an example to only use efficient-cores for inference on hybrid CPU. If user sets this + * configuration on a platform with only performance-cores, CPU inference will still run on the performance-cores. + * + * @code + * ie.set_property(ov::hint::scheduling_core_type(ov::hint::SchedulingCoreType::ECORE_ONLY)); + * @endcode + */ +static constexpr Property scheduling_core_type{"SCHEDULING_CORE_TYPE"}; + /** * @brief This property allows hyper threading during inference. * @ingroup ov_runtime_cpp_prop_api diff --git a/src/inference/src/dev/threading/cpu_map_scheduling.cpp b/src/inference/src/dev/threading/cpu_map_scheduling.cpp index 42ed0e33272..1ba22fb3090 100644 --- a/src/inference/src/dev/threading/cpu_map_scheduling.cpp +++ b/src/inference/src/dev/threading/cpu_map_scheduling.cpp @@ -8,9 +8,41 @@ namespace ov { +std::vector> apply_scheduling_core_type(const ov::hint::SchedulingCoreType input_type, + const std::vector>& proc_type_table) { + std::vector> result_table = proc_type_table; + + switch (input_type) { + case ov::hint::SchedulingCoreType::ANY_CORE: + break; + case ov::hint::SchedulingCoreType::PCORE_ONLY: + if (proc_type_table[0][EFFICIENT_CORE_PROC] > 0) { + for (auto& i : result_table) { + i[ALL_PROC] -= i[EFFICIENT_CORE_PROC]; + i[EFFICIENT_CORE_PROC] = 0; + } + } + break; + case ov::hint::SchedulingCoreType::ECORE_ONLY: + if ((proc_type_table[0][EFFICIENT_CORE_PROC] > 0) && + (proc_type_table[0][EFFICIENT_CORE_PROC] != proc_type_table[0][ALL_PROC])) { + for (auto& i : result_table) { + i[ALL_PROC] -= i[MAIN_CORE_PROC] + i[HYPER_THREADING_PROC]; + i[MAIN_CORE_PROC] = 0; + i[HYPER_THREADING_PROC] = 0; + } + } + break; + default: + throw ov::Exception{"Unsupported core type!"}; + } + + return result_table; +} + std::vector> apply_hyper_threading(bool input_value, const bool input_changed, - const std::vector> proc_type_table) { + const std::vector>& proc_type_table) { std::vector> result_table = proc_type_table; if ((proc_type_table[0][HYPER_THREADING_PROC] > 0) && diff --git a/src/plugins/intel_cpu/src/config.cpp b/src/plugins/intel_cpu/src/config.cpp index be8a40d5626..8407639d873 100644 --- a/src/plugins/intel_cpu/src/config.cpp +++ b/src/plugins/intel_cpu/src/config.cpp @@ -78,6 +78,18 @@ void Config::readProperties(const std::map &prop) { streamExecutorConfig.SetConfig(key, val); } else if (hintsConfigKeys.end() != std::find(hintsConfigKeys.begin(), hintsConfigKeys.end(), key)) { perfHintsConfig.SetConfig(key, val); + } else if (key == ov::hint::scheduling_core_type.name()) { + const auto core_type = ov::util::from_string(val, ov::hint::scheduling_core_type); + if (core_type == ov::hint::SchedulingCoreType::ANY_CORE || + core_type == ov::hint::SchedulingCoreType::PCORE_ONLY || + core_type == ov::hint::SchedulingCoreType::ECORE_ONLY) { + schedulingCoreType = core_type; + } else { + IE_THROW() << "Wrong value " << val << "for property key " << ov::hint::scheduling_core_type.name() + << ". Expected only " << ov::hint::SchedulingCoreType::ANY_CORE << "/" + << ov::hint::SchedulingCoreType::PCORE_ONLY << "/" + << ov::hint::SchedulingCoreType::ECORE_ONLY << std::endl; + } } else if (key == ov::hint::use_hyper_threading.name()) { if (val == PluginConfigParams::YES) { useHyperThreading = true; diff --git a/src/plugins/intel_cpu/src/config.h b/src/plugins/intel_cpu/src/config.h index 27f83229002..0f22ce45bb1 100644 --- a/src/plugins/intel_cpu/src/config.h +++ b/src/plugins/intel_cpu/src/config.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "utils/debug_caps_config.h" @@ -49,6 +50,7 @@ struct Config { size_t rtCacheCapacity = 5000ul; InferenceEngine::IStreamsExecutor::Config streamExecutorConfig; InferenceEngine::PerfHintsConfig perfHintsConfig; + ov::hint::SchedulingCoreType schedulingCoreType = ov::hint::SchedulingCoreType::ANY_CORE; bool useHyperThreading = true; bool changedHyperThreading = false; #if defined(OPENVINO_ARCH_X86) || defined(OPENVINO_ARCH_X86_64) diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp index ea5111015d9..e8edac81094 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp @@ -86,7 +86,7 @@ std::vector> get_streams_info_table(const int input_streams, (n_threads_per_stream < proc_type_table[0][MAIN_CORE_PROC] * 2)) { n_threads_per_stream = proc_type_table[0][MAIN_CORE_PROC]; } else if (n_threads_per_stream < proc_type_table[0][MAIN_CORE_PROC]) { - n_threads_per_stream = int( + n_threads_per_stream = static_cast( proc_type_table[0][MAIN_CORE_PROC] / ((proc_type_table[0][MAIN_CORE_PROC] + n_threads_per_stream - 1) / n_threads_per_stream)); } diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp index e331035567b..eae73a0a3e8 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp @@ -11,6 +11,7 @@ #include +#include "openvino/runtime/properties.hpp" namespace ov { namespace intel_cpu { diff --git a/src/plugins/intel_cpu/src/exec_network.cpp b/src/plugins/intel_cpu/src/exec_network.cpp index 72dc81f58f8..07c2f139b0c 100644 --- a/src/plugins/intel_cpu/src/exec_network.cpp +++ b/src/plugins/intel_cpu/src/exec_network.cpp @@ -308,6 +308,7 @@ InferenceEngine::Parameter ExecNetwork::GetMetric(const std::string &name) const RO_property(ov::inference_precision.name()), RO_property(ov::hint::performance_mode.name()), RO_property(ov::hint::num_requests.name()), + RO_property(ov::hint::scheduling_core_type.name()), RO_property(ov::hint::use_hyper_threading.name()), RO_property(ov::execution_devices.name()), }; @@ -349,6 +350,9 @@ InferenceEngine::Parameter ExecNetwork::GetMetric(const std::string &name) const } else if (name == ov::hint::performance_mode) { const auto perfHint = ov::util::from_string(config.perfHintsConfig.ovPerfHint, ov::hint::performance_mode); return perfHint; + } else if (name == ov::hint::scheduling_core_type) { + const auto core_type = config.schedulingCoreType; + return core_type; } else if (name == ov::hint::use_hyper_threading.name()) { const bool use_ht = config.useHyperThreading; return decltype(ov::hint::use_hyper_threading)::value_type(use_ht); diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp index b2af5acfea3..daaae2ecf93 100644 --- a/src/plugins/intel_cpu/src/plugin.cpp +++ b/src/plugins/intel_cpu/src/plugin.cpp @@ -514,6 +514,9 @@ Parameter Engine::GetConfig(const std::string& name, const std::map> proc_type_table; + std::vector> result_table; +}; + +class SchedulingCoreTypeTests : public CommonTestUtils::TestsCommon, + public testing::WithParamInterface> { +public: + void SetUp() override { + const auto& test_data = std::get<0>(GetParam()); + + std::vector> test_result_table = + ov::apply_scheduling_core_type(test_data.input_type, test_data.proc_type_table); + + ASSERT_EQ(test_data.result_table, test_result_table); + } +}; + +SchedulingCoreTypeTestCase _2sockets_ALL = { + ov::hint::SchedulingCoreType::ANY_CORE, + {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, +}; + +SchedulingCoreTypeTestCase _2sockets_P_CORE_ONLY = { + ov::hint::SchedulingCoreType::PCORE_ONLY, + {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, +}; + +SchedulingCoreTypeTestCase _2sockets_E_CORE_ONLY = { + ov::hint::SchedulingCoreType::ECORE_ONLY, + {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, +}; + +SchedulingCoreTypeTestCase _1sockets_ALL = { + ov::hint::SchedulingCoreType::ANY_CORE, + {{20, 6, 8, 6}}, + {{20, 6, 8, 6}}, +}; + +SchedulingCoreTypeTestCase _1sockets_P_CORE_ONLY = { + ov::hint::SchedulingCoreType::PCORE_ONLY, + {{20, 6, 8, 6}}, + {{12, 6, 0, 6}}, +}; + +SchedulingCoreTypeTestCase _1sockets_E_CORE_ONLY = { + ov::hint::SchedulingCoreType::ECORE_ONLY, + {{20, 6, 8, 6}}, + {{8, 0, 8, 0}}, +}; + +TEST_P(SchedulingCoreTypeTests, SchedulingCoreType) {} + +INSTANTIATE_TEST_SUITE_P(SchedulingCoreTypeTable, + SchedulingCoreTypeTests, + testing::Values(_2sockets_ALL, + _2sockets_P_CORE_ONLY, + _2sockets_E_CORE_ONLY, + _1sockets_ALL, + _1sockets_P_CORE_ONLY, + _1sockets_E_CORE_ONLY)); + struct UseHTTestCase { bool use_ht_value; bool use_ht_changed; @@ -29,9 +95,7 @@ public: const auto& test_data = std::get<0>(GetParam()); std::vector> test_result_table = - ov::apply_hyper_threading(test_data.use_ht_value, - test_data.use_ht_changed, - test_data.proc_type_table); + ov::apply_hyper_threading(test_data.use_ht_value, test_data.use_ht_changed, test_data.proc_type_table); ASSERT_EQ(test_data.result_table, test_result_table); } diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp index fa9b3f22fcb..4beca9da873 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp @@ -121,6 +121,7 @@ using OVClassLoadNetworkTest = OVClassQueryNetworkTest; using OVClassSetGlobalConfigTest = OVClassBaseTestP; using OVClassSetModelPriorityConfigTest = OVClassBaseTestP; using OVClassSetExecutionModeHintConfigTest = OVClassBaseTestP; +using OVClassSetSchedulingCoreTypeHintConfigTest = OVClassBaseTestP; using OVClassSetUseHyperThreadingHintConfigTest = OVClassBaseTestP; using OVClassSetTBBForceTerminatePropertyTest = OVClassBaseTestP; using OVClassSetLogLevelConfigTest = OVClassBaseTestP; @@ -612,6 +613,25 @@ TEST_P(OVClassSetExecutionModeHintConfigTest, SetConfigNoThrow) { ASSERT_EQ(ov::hint::ExecutionMode::PERFORMANCE, ie.get_property(target_device, ov::hint::execution_mode)); } +TEST_P(OVClassSetSchedulingCoreTypeHintConfigTest, SetConfigNoThrow) { + ov::Core ie = createCoreWithTemplate(); + + OV_ASSERT_PROPERTY_SUPPORTED(ov::hint::scheduling_core_type); + + ov::hint::SchedulingCoreType defaultMode{}; + ASSERT_NO_THROW(defaultMode = ie.get_property(target_device, ov::hint::scheduling_core_type)); + (void)defaultMode; + + ASSERT_EQ(ov::hint::SchedulingCoreType::ANY_CORE, ie.get_property(target_device, ov::hint::scheduling_core_type)); + + ie.set_property(target_device, ov::hint::scheduling_core_type(ov::hint::SchedulingCoreType::PCORE_ONLY)); + ASSERT_EQ(ov::hint::SchedulingCoreType::PCORE_ONLY, ie.get_property(target_device, ov::hint::scheduling_core_type)); + ie.set_property(target_device, ov::hint::scheduling_core_type(ov::hint::SchedulingCoreType::ECORE_ONLY)); + ASSERT_EQ(ov::hint::SchedulingCoreType::ECORE_ONLY, ie.get_property(target_device, ov::hint::scheduling_core_type)); + ie.set_property(target_device, ov::hint::scheduling_core_type(ov::hint::SchedulingCoreType::ANY_CORE)); + ASSERT_EQ(ov::hint::SchedulingCoreType::ANY_CORE, ie.get_property(target_device, ov::hint::scheduling_core_type)); +} + TEST_P(OVClassSetUseHyperThreadingHintConfigTest, SetConfigNoThrow) { ov::Core ie = createCoreWithTemplate();