diff --git a/src/inference/dev_api/openvino/runtime/system_conf.hpp b/src/inference/dev_api/openvino/runtime/system_conf.hpp index b6d2e0ad063e13..7da839919ea7a5 100644 --- a/src/inference/dev_api/openvino/runtime/system_conf.hpp +++ b/src/inference/dev_api/openvino/runtime/system_conf.hpp @@ -175,11 +175,13 @@ OPENVINO_RUNTIME_API bool with_cpu_x86_avx512_core_amx_fp16(); OPENVINO_RUNTIME_API bool with_cpu_x86_avx512_core_amx(); /** - * @brief Checks whether cpu_mapping Available + * @brief Checks whether cpu_pinning and cpu_reservation are available * @ingroup ov_dev_api_system_conf - * @return `True` is CPU mapping is available, `false` otherwise */ -OPENVINO_RUNTIME_API bool is_cpu_map_available(); +OPENVINO_RUNTIME_API void cpu_pinning_available(bool& cpu_pinning, + const bool cpu_pinning_changed, + bool& cpu_reservation, + const std::vector>& streams_info_table); /** * @brief Get number of numa nodes diff --git a/src/inference/src/dev/threading/cpu_streams_executor.cpp b/src/inference/src/dev/threading/cpu_streams_executor.cpp index e944e45ccdddc0..0eae5836bd5afa 100644 --- a/src/inference/src/dev/threading/cpu_streams_executor.cpp +++ b/src/inference/src/dev/threading/cpu_streams_executor.cpp @@ -67,7 +67,7 @@ struct CPUStreamsExecutor::Impl { _impl->_usedNumaNodes.size())) : _impl->_usedNumaNodes.at(_streamId % _impl->_usedNumaNodes.size()); #if OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO - if (is_cpu_map_available() && _impl->_config.get_streams_info_table().size() > 0) { + if (_impl->_config.get_streams_info_table().size() > 0) { init_stream(); } #elif OV_THREAD == OV_THREAD_OMP diff --git a/src/inference/src/system_conf.cpp b/src/inference/src/system_conf.cpp index 18c0d1d8240303..99e90ad673c77f 100644 --- a/src/inference/src/system_conf.cpp +++ b/src/inference/src/system_conf.cpp @@ -271,9 +271,10 @@ std::vector> get_proc_type_table() { std::vector> get_org_proc_type_table() { return {{-1}}; } -bool is_cpu_map_available() { - return false; -} +void cpu_pinning_available(bool& cpu_pinning, + const bool cpu_pinning_changed, + bool& cpu_reservation, + const std::vector>& streams_info_table) {} int get_num_numa_nodes() { return -1; } @@ -313,9 +314,15 @@ int get_number_of_blocked_cores() { return cpu._blocked_cores; } -bool is_cpu_map_available() { +void cpu_pinning_available(bool& cpu_pinning, + const bool cpu_pinning_changed, + bool& cpu_reservation, + const std::vector>& streams_info_table) { CPU& cpu = cpu_info(); - return cpu._proc_type_table.size() > 0; + if (cpu._cpu_mapping_table.size() == 0) { + cpu_pinning = false; + cpu_reservation = false; + } } int get_current_socket_id() { @@ -393,6 +400,24 @@ std::vector get_available_numa_nodes() { return nodes; } # endif + +void cpu_pinning_available(bool& cpu_pinning, + const bool cpu_pinning_changed, + bool& cpu_reservation, + const std::vector>& streams_info_table) { + if (!cpu_pinning_changed) { + cpu_pinning = true; + // The following code disables pinning in case stream contains both Pcore and Ecore + if (streams_info_table.size() >= 3) { + if ((streams_info_table[0][PROC_TYPE] == ALL_PROC) && + (streams_info_table[1][PROC_TYPE] != EFFICIENT_CORE_PROC) && + (streams_info_table[2][PROC_TYPE] == EFFICIENT_CORE_PROC)) { + cpu_pinning = cpu_reservation; + } + } + } +} + int get_current_socket_id() { CPU& cpu = cpu_info(); int cur_processor_id = sched_getcpu(); @@ -419,6 +444,18 @@ int get_current_numa_node_id() { return 0; } # else +void cpu_pinning_available(bool& cpu_pinning, + const bool cpu_pinning_changed, + bool& cpu_reservation, + const std::vector>& streams_info_table) { + CPU& cpu = cpu_info(); + if (cpu._proc_type_table.size() == 1) { + cpu_pinning = cpu_pinning_changed ? cpu_pinning : cpu_reservation; + } else { // multiple sockets machine + cpu_pinning = false; + } +} + int get_current_socket_id() { CPU& cpu = cpu_info(); int cur_processor_id = GetCurrentProcessorNumber(); @@ -457,11 +494,6 @@ std::vector> get_org_proc_type_table() { return cpu._org_proc_type_table; } -bool is_cpu_map_available() { - CPU& cpu = cpu_info(); - return cpu._cpu_mapping_table.size() > 0; -} - int get_num_numa_nodes() { return cpu_info()._numa_nodes; } diff --git a/src/plugins/intel_cpu/src/cpu_map_scheduling.cpp b/src/plugins/intel_cpu/src/cpu_map_scheduling.cpp index ecc585bb44888e..d743ad0388da39 100644 --- a/src/plugins/intel_cpu/src/cpu_map_scheduling.cpp +++ b/src/plugins/intel_cpu/src/cpu_map_scheduling.cpp @@ -69,40 +69,4 @@ std::vector> apply_hyper_threading(bool& input_ht_hint, return result_table; } -bool get_cpu_pinning(bool& input_value, - const bool input_changed, - const bool cpu_reservation, - const std::vector>& proc_type_table, - const std::vector>& streams_info_table) { - bool result_value; - -#if defined(__APPLE__) - result_value = false; -#elif defined(_WIN32) - if (proc_type_table.size() == 1) { - result_value = input_changed ? input_value : cpu_reservation; - } else { - result_value = false; - } -#else - if (input_changed) { - result_value = input_value; - } else { - result_value = true; - // The following code disables pinning in case stream contains both Pcore and Ecore - if (streams_info_table.size() >= 3) { - if ((streams_info_table[0][PROC_TYPE] == ALL_PROC) && - (streams_info_table[1][PROC_TYPE] != EFFICIENT_CORE_PROC) && - (streams_info_table[2][PROC_TYPE] == EFFICIENT_CORE_PROC)) { - result_value = cpu_reservation; - } - } - } -#endif - - input_value = result_value; - - return result_value; -} - } // namespace ov::intel_cpu diff --git a/src/plugins/intel_cpu/src/cpu_map_scheduling.hpp b/src/plugins/intel_cpu/src/cpu_map_scheduling.hpp index 8cdd9b5aa246e5..78b3b2011e3638 100644 --- a/src/plugins/intel_cpu/src/cpu_map_scheduling.hpp +++ b/src/plugins/intel_cpu/src/cpu_map_scheduling.hpp @@ -39,19 +39,4 @@ std::vector> apply_hyper_threading(bool& input_ht_hint, const std::string& input_pm_hint, const std::vector>& proc_type_table); -/** - * @brief whether pinning cpu cores according to enableCpuPinning property - * @param[in] input_type indicate value of property enableCpuPinning. - * @param[in] input_changed indicate if value is set by user. - * @param[in] cpu_reservation indicate if cpu need to be reserved - * @param[in] proc_type_table indicate processors information of this platform - * @param[in] streams_info_table indicate streams detail of this model - * @return whether pinning threads to cpu cores - */ -bool get_cpu_pinning(bool& input_value, - const bool input_changed, - const bool cpu_reservation, - const std::vector>& proc_type_table, - const std::vector>& streams_info_table); - } // namespace ov::intel_cpu diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp index 9af40cdced1387..54ade9bbf46783 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp @@ -732,18 +732,17 @@ std::vector> generate_stream_info(const int streams, get_streams_rank_table(streams_info_table, config.streamsRankLevel, config.numSubStreams); } - auto cpu_pinning = get_cpu_pinning(config.enableCpuPinning, - config.changedCpuPinning, - config.enableCpuReservation, - proc_type_table, - streams_info_table); + cpu_pinning_available(config.enableCpuPinning, + config.changedCpuPinning, + config.enableCpuReservation, + streams_info_table); config.streamExecutorConfig = IStreamsExecutor::Config{"CPUStreamsExecutor", config.streams, config.threadsPerStream, ov::hint::SchedulingCoreType::ANY_CORE, config.enableCpuReservation, - cpu_pinning, + config.enableCpuPinning, true, std::move(streams_info_table), {}, diff --git a/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_executable_network/properties.cpp b/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_executable_network/properties.cpp index ee819ad4646c81..c0ae5cbe35b6ba 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_executable_network/properties.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_executable_network/properties.cpp @@ -12,6 +12,10 @@ #include "openvino/runtime/system_conf.hpp" #include "utils/properties_test.hpp" +#if defined(_WIN32) +# include +#endif + namespace { TEST_F(OVClassConfigTestCPU, smoke_CpuExecNetworkSupportedPropertiesAreAvailable) { @@ -159,6 +163,47 @@ TEST_F(OVClassConfigTestCPU, smoke_CpuExecNetworkCheckModelZeroStreams) { ASSERT_EQ(streams, value); } +TEST_F(OVClassConfigTestCPU, smoke_CpuExecNetworkCheckCpuReservation) { + ov::Core ie; + int32_t threads = 1; + int32_t res_threads = -1; + bool cpu_reservation = true; + bool res_cpu_reservation = false; + bool cpu_pinning = false; + bool res_cpu_pinning = false; + +#if defined(__APPLE__) + cpu_reservation = false; + cpu_pinning = false; +#elif defined(__linux__) + cpu_pinning = true; +#elif defined(_WIN32) + ULONG highestNodeNumber = 0; + if (!GetNumaHighestNodeNumber(&highestNodeNumber)) { + std::cout << "Error getting highest NUMA node number: " << GetLastError() << std::endl; + return; + } + if (highestNodeNumber > 0) { + cpu_pinning = false; + } else { + cpu_pinning = true; + } +#endif + + OV_ASSERT_NO_THROW(ie.set_property(deviceName, ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY))); + + ov::AnyMap config = {{ov::inference_num_threads.name(), threads}, {ov::hint::enable_cpu_reservation.name(), true}}; + ov::CompiledModel compiledModel = ie.compile_model(model, deviceName, config); + + OV_ASSERT_NO_THROW(res_threads = compiledModel.get_property(ov::inference_num_threads)); + OV_ASSERT_NO_THROW(res_cpu_reservation = compiledModel.get_property(ov::hint::enable_cpu_reservation)); + OV_ASSERT_NO_THROW(res_cpu_pinning = compiledModel.get_property(ov::hint::enable_cpu_pinning)); + + ASSERT_EQ(res_threads, threads); + ASSERT_EQ(res_cpu_reservation, cpu_reservation); + ASSERT_EQ(res_cpu_pinning, cpu_pinning); +} + TEST_F(OVClassConfigTestCPU, smoke_CpuExecNetworkCheckSparseWeigthsDecompressionRate) { ov::Core core; diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/compiled_model/cpu_reservation_test.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/compiled_model/cpu_reservation_test.cpp index 87a19ede785eba..112ff9724dad38 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/compiled_model/cpu_reservation_test.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/compiled_model/cpu_reservation_test.cpp @@ -15,11 +15,16 @@ #include "openvino/runtime/properties.hpp" #include "openvino/util/file_util.hpp" +#if defined(_WIN32) +# include +#endif + using namespace testing; using Device = std::string; using Config = ov::AnyMap; using CpuReservationTest = ::testing::Test; +#if (defined(__linux__) || defined(__WIN32)) TEST_F(CpuReservationTest, Mutiple_CompiledModel_Reservation) { std::vector> models; Config config = {ov::enable_profiling(true)}; @@ -72,19 +77,34 @@ TEST_F(CpuReservationTest, Cpu_Reservation_NoAvailableCores) { EXPECT_THROW(core->compile_model(models[0], target_device, property_config), ov::Exception); } -#if defined(__linux__) TEST_F(CpuReservationTest, Cpu_Reservation_CpuPinning) { std::vector> models; Config config = {ov::enable_profiling(true)}; Device target_device(ov::test::utils::DEVICE_CPU); models.emplace_back(ov::test::utils::make_2_input_subtract()); + bool cpu_pinning = false; + +#if defined(__linux__) + cpu_pinning = true; +#elif defined(_WIN32) + ULONG highestNodeNumber = 0; + if (!GetNumaHighestNodeNumber(&highestNodeNumber)) { + std::cout << "Error getting highest NUMA node number: " << GetLastError() << std::endl; + return; + } + if (highestNodeNumber > 0) { + cpu_pinning = false; + } else { + cpu_pinning = true; + } +#endif std::shared_ptr core = ov::test::utils::PluginCache::get().core(); core->set_property(target_device, config); ov::AnyMap property_config = {{ov::inference_num_threads.name(), 1}, {ov::hint::enable_cpu_reservation.name(), true}}; auto compiled_model = core->compile_model(models[0], target_device, property_config); - auto cpu_pinning = compiled_model.get_property(ov::hint::enable_cpu_pinning.name()); - ASSERT_EQ(cpu_pinning, true); + auto res_cpu_pinning = compiled_model.get_property(ov::hint::enable_cpu_pinning.name()); + ASSERT_EQ(res_cpu_pinning, cpu_pinning); } #endif diff --git a/src/plugins/intel_cpu/tests/unit/streams_info/cpu_pinning_test.cpp b/src/plugins/intel_cpu/tests/unit/streams_info/cpu_pinning_test.cpp index 60d058a6cd0ce0..94d2b9caf9d2a2 100644 --- a/src/plugins/intel_cpu/tests/unit/streams_info/cpu_pinning_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/streams_info/cpu_pinning_test.cpp @@ -7,6 +7,7 @@ #include "common_test_utils/test_common.hpp" #include "cpu_map_scheduling.hpp" #include "openvino/runtime/system_conf.hpp" +#include "os/cpu_map_info.hpp" using namespace testing; using namespace ov; @@ -16,6 +17,7 @@ namespace { struct CpuPinningTestCase { bool input_cpu_pinning; bool input_changed; + std::vector> input_cpu_map_table; std::vector> input_proc_type_table; std::vector> input_stream_info_table; bool output_cpu_pinning; @@ -26,15 +28,20 @@ class CpuPinningTests : public ov::test::TestsCommon, public: void SetUp() override { auto test_data = std::get<0>(GetParam()); + CPU& cpu = cpu_info(); + cpu._cpu_mapping_table = test_data.input_cpu_map_table; + cpu._proc_type_table = test_data.input_proc_type_table; + cpu._org_proc_type_table = test_data.input_proc_type_table; + cpu._numa_nodes = cpu._proc_type_table.size() > 1 ? static_cast(cpu._proc_type_table.size()) - 1 : 1; + cpu._sockets = cpu._numa_nodes; + bool cpu_reservation = false; - auto test_output = ov::intel_cpu::get_cpu_pinning(test_data.input_cpu_pinning, - test_data.input_changed, - false, - test_data.input_proc_type_table, - test_data.input_stream_info_table); + cpu_pinning_available(test_data.input_cpu_pinning, + test_data.input_changed, + cpu_reservation, + test_data.input_stream_info_table); ASSERT_EQ(test_data.output_cpu_pinning, test_data.input_cpu_pinning); - ASSERT_EQ(test_data.output_cpu_pinning, test_output); } }; @@ -43,6 +50,7 @@ TEST_P(CpuPinningTests, CpuPinning) {} CpuPinningTestCase cpu_pinning_macos_mock_set_true = { true, // param[in]: simulated settting for cpu pinning property true, // param[in]: simulated settting for user changing cpu pinning property + {}, // param[in]: simulated setting for current cpu_mapping_table {{40, 20, 0, 20, 0, 0}}, // param[in]: simulated setting for current proc_type_table {{1, MAIN_CORE_PROC, 20, 0, 0}}, // param[in]: simulated setting for current streams_info_table false, // param[expected out]: simulated setting for expected output @@ -50,6 +58,7 @@ CpuPinningTestCase cpu_pinning_macos_mock_set_true = { CpuPinningTestCase cpu_pinning_macos_mock_set_false = { false, true, + {}, {{40, 20, 0, 20, 0, 0}}, {{1, MAIN_CORE_PROC, 20, 0, 0}}, false, @@ -57,6 +66,7 @@ CpuPinningTestCase cpu_pinning_macos_mock_set_false = { CpuPinningTestCase cpu_pinning_macos_mock_set_default = { true, false, + {}, {{40, 20, 0, 20, 0, 0}}, {{1, MAIN_CORE_PROC, 20, 0, 0}}, false, @@ -64,6 +74,28 @@ CpuPinningTestCase cpu_pinning_macos_mock_set_default = { CpuPinningTestCase cpu_pinning_win_mock_set_true = { true, true, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {25, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {26, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {27, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {28, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {29, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {30, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {31, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {32, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, {33, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {34, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, {35, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + }, {{40, 20, 0, 20, 0, 0}}, {{1, MAIN_CORE_PROC, 20, 0, 0}}, true, @@ -71,6 +103,32 @@ CpuPinningTestCase cpu_pinning_win_mock_set_true = { CpuPinningTestCase cpu_pinning_win_mock_set_true_2 = { true, true, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{1, MAIN_CORE_PROC, 24, 0, 0}}, false, @@ -78,6 +136,28 @@ CpuPinningTestCase cpu_pinning_win_mock_set_true_2 = { CpuPinningTestCase cpu_pinning_win_mock_set_false = { false, true, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {25, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {26, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {27, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {28, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {29, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {30, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {31, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {32, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, {33, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {34, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, {35, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + }, {{40, 20, 0, 20, 0, 0}}, {{1, MAIN_CORE_PROC, 20, 0, 0}}, false, @@ -85,6 +165,32 @@ CpuPinningTestCase cpu_pinning_win_mock_set_false = { CpuPinningTestCase cpu_pinning_win_mock_set_false_2 = { false, true, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{1, MAIN_CORE_PROC, 24, 0, 0}}, false, @@ -92,6 +198,28 @@ CpuPinningTestCase cpu_pinning_win_mock_set_false_2 = { CpuPinningTestCase cpu_pinning_win_mock_set_default = { true, false, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {25, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {26, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {27, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {28, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {29, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {30, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {31, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {32, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, {33, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {34, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, {35, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + }, {{40, 20, 0, 20, 0, 0}}, {{1, MAIN_CORE_PROC, 20, 0, 0}}, false, @@ -99,6 +227,32 @@ CpuPinningTestCase cpu_pinning_win_mock_set_default = { CpuPinningTestCase cpu_pinning_win_mock_set_default_2 = { true, false, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{1, MAIN_CORE_PROC, 24, 0, 0}}, false, @@ -106,6 +260,28 @@ CpuPinningTestCase cpu_pinning_win_mock_set_default_2 = { CpuPinningTestCase cpu_pinning_linux_mock_set_true = { true, true, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {25, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {26, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {27, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {28, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {29, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {30, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {31, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {32, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, {33, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {34, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, {35, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + }, {{40, 20, 0, 20, 0, 0}}, {{1, MAIN_CORE_PROC, 20, 0, 0}}, true, @@ -113,6 +289,32 @@ CpuPinningTestCase cpu_pinning_linux_mock_set_true = { CpuPinningTestCase cpu_pinning_linux_mock_set_true_2 = { true, true, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{1, MAIN_CORE_PROC, 24, 0, 0}}, true, @@ -120,6 +322,28 @@ CpuPinningTestCase cpu_pinning_linux_mock_set_true_2 = { CpuPinningTestCase cpu_pinning_linux_mock_set_false = { false, true, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {25, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {26, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {27, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {28, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {29, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {30, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {31, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {32, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, {33, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {34, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, {35, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + }, {{40, 20, 0, 20, 0, 0}}, {{1, MAIN_CORE_PROC, 20, 0, 0}}, false, @@ -127,6 +351,32 @@ CpuPinningTestCase cpu_pinning_linux_mock_set_false = { CpuPinningTestCase cpu_pinning_linux_mock_set_false_2 = { false, true, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{1, MAIN_CORE_PROC, 24, 0, 0}}, false, @@ -134,6 +384,28 @@ CpuPinningTestCase cpu_pinning_linux_mock_set_false_2 = { CpuPinningTestCase cpu_pinning_linux_mock_set_default = { false, false, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {25, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {26, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {27, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {28, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {29, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {30, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {31, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {32, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, {33, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {34, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, {35, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + }, {{40, 20, 0, 20, 0, 0}}, {{1, MAIN_CORE_PROC, 20, 0, 0}}, true, @@ -141,6 +413,18 @@ CpuPinningTestCase cpu_pinning_linux_mock_set_default = { CpuPinningTestCase cpu_pinning_linux_mock_set_default_2 = { true, false, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, EFFICIENT_CORE_PROC, 12, -1}, {13, 0, 0, 7, EFFICIENT_CORE_PROC, 13, -1}, + {14, 0, 0, 8, EFFICIENT_CORE_PROC, 14, -1}, {15, 0, 0, 9, EFFICIENT_CORE_PROC, 15, -1}, + {16, 0, 0, 10, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 11, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 12, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 13, EFFICIENT_CORE_PROC, 19, -1}, + }, {{20, 6, 8, 6, 0, 0}}, {{1, ALL_PROC, 14, 0, 0}, {0, MAIN_CORE_PROC, 6, 0, 0}, {0, EFFICIENT_CORE_PROC, 8, 0, 0}}, false, @@ -148,6 +432,32 @@ CpuPinningTestCase cpu_pinning_linux_mock_set_default_2 = { CpuPinningTestCase cpu_pinning_linux_mock_set_default_3 = { false, false, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{1, MAIN_CORE_PROC, 24, 0, 0}}, true, diff --git a/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp b/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp index a6981cfbbe1498..732ce00e59c51d 100644 --- a/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp @@ -66,13 +66,18 @@ class StreamGenerationTests : public ov::test::TestsCommon, make_config(test_data, config); CPU& cpu = cpu_info(); +#if defined(__linux__) || defined(_WIN32) cpu._cpu_mapping_table = test_data.cpu_mapping_table; +#else + cpu._cpu_mapping_table = {}; +#endif cpu._proc_type_table = test_data.input_proc_type_table; cpu._org_proc_type_table = test_data.input_proc_type_table; cpu._numa_nodes = cpu._proc_type_table.size() > 1 ? static_cast(cpu._proc_type_table.size()) - 1 : 1; cpu._sockets = cpu._numa_nodes; std::vector> res_proc_type_table = test_data.input_proc_type_table; +#if defined(__linux__) || defined(_WIN32) if (cpu._cpu_mapping_table.empty()) { EXPECT_THROW(ov::intel_cpu::generate_stream_info(test_data.input_stream, test_data.input_numa_node_id, @@ -82,6 +87,7 @@ class StreamGenerationTests : public ov::test::TestsCommon, test_data.input_model_prefer), ov::Exception); } else { +#endif auto proc_type_table = ov::intel_cpu::generate_stream_info(test_data.input_stream, test_data.input_numa_node_id, nullptr, @@ -125,7 +131,9 @@ class StreamGenerationTests : public ov::test::TestsCommon, ASSERT_EQ(res_proc_type_table, cpu._proc_type_table); } } +#if defined(__linux__) || defined(_WIN32) } +#endif }; TEST_P(StreamGenerationTests, StreamsGeneration) {}