IPPSortManager ============== .. cpp:class:: numpy::IPPSortManager numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use IPPSortManager IPPSortManager obj; // ... operations ... Indexing / Selection -------------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``const IPPSortConfig & get_config()`` - const IPPSortConfig & - NP_IPP_CONFIG.H:194 - * - ``SortBackend get_default_backend()`` - SortBackend - NP_IPP_CONFIG.H:215 - :ref:`View ` Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``void auto_tune_thresholds()`` - void - NP_IPP_CONFIG.H:275 - * - ``void reset_to_defaults()`` - void - NP_IPP_CONFIG.H:283 - * - ``SortBackend resolve_backend(SortBackendrequested = SortBackend::AUTO)`` - SortBackend - NP_IPP_CONFIG.H:222 - :ref:`View ` * - ``void set_config(const IPPSortConfig &new_config)`` - void - NP_IPP_CONFIG.H:201 - * - ``void set_default_backend(SortBackendbackend)`` - void - NP_IPP_CONFIG.H:208 - :ref:`View ` * - ``bool should_use_ipp(SortBackendrequested = SortBackend::AUTO)`` - bool - NP_IPP_CONFIG.H:243 - * - ``bool should_use_ipp_for_floats(SortBackendrequested = SortBackend::AUTO)`` - bool - NP_IPP_CONFIG.H:268 - * - ``bool should_use_ipp_for_small_arrays(size_tarray_size, SortBackendrequested = SortBackend::AUTO)`` - bool - NP_IPP_CONFIG.H:259 - * - ``bool should_use_radix_sort(size_tarray_size, SortBackendrequested = SortBackend::AUTO)`` - bool - NP_IPP_CONFIG.H:250 - Code Examples ------------- The following examples are extracted from the test suite. .. _example-ippsortmanager-get_default_backend-0: .. dropdown:: get_default_backend (np_test_1_all.cpp:25367) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 25357 :emphasize-lines: 11 // std::cout << "[OK] BoostInfo tests passed" << std::endl; } void test_boost_config() { std::cout << "========= Testing BoostConfig ==================="; using namespace numpy::boost_lib; // Test default backend Backend default_backend = BoostConfig::get_default_backend(); // std::cout << "Default backend: " // << (default_backend == Backend::AUTO ? "AUTO" : // default_backend == Backend::BOOST ? "BOOST" : "STANDARD") // << std::endl; // Test backend resolution Backend resolved_auto = BoostConfig::resolve_backend(Backend::AUTO); // std::cout << "Resolved AUTO backend: " // << (resolved_auto == Backend::BOOST ? "BOOST" : "STANDARD") // << std::endl; .. _example-ippsortmanager-resolve_backend-1: .. dropdown:: resolve_backend (np_test_1_all.cpp:25374) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 25364 :emphasize-lines: 11 using namespace numpy::boost_lib; // Test default backend Backend default_backend = BoostConfig::get_default_backend(); // std::cout << "Default backend: " // << (default_backend == Backend::AUTO ? "AUTO" : // default_backend == Backend::BOOST ? "BOOST" : "STANDARD") // << std::endl; // Test backend resolution Backend resolved_auto = BoostConfig::resolve_backend(Backend::AUTO); // std::cout << "Resolved AUTO backend: " // << (resolved_auto == Backend::BOOST ? "BOOST" : "STANDARD") // << std::endl; // Test should_use_boost bool use_boost = BoostConfig::should_use_boost(Backend::AUTO); // std::cout << "Should use Boost (AUTO): " << (use_boost ? "Yes" : "No") << std::endl; // Verify consistency if (BoostInfo::is_runtime_available()) { .. _example-ippsortmanager-set_default_backend-2: .. dropdown:: set_default_backend (np_test_1_all.cpp:25414) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 25404 :emphasize-lines: 11 // Test forced STANDARD backend bool use_standard = BoostConfig::should_use_boost(Backend::STANDARD); if (use_standard) { throw std::runtime_error("Forced STANDARD backend not working"); } // std::cout << "[OK] Forced STANDARD backend works" << std::endl; // Test backend setting Backend original = BoostConfig::get_default_backend(); BoostConfig::set_default_backend(Backend::STANDARD); if (BoostConfig::get_default_backend() != Backend::STANDARD) { throw std::runtime_error("Backend setting not working"); } BoostConfig::set_default_backend(original); // Restore // std::cout << "[OK] Backend setting works" << std::endl; // std::cout << "[OK] BoostConfig tests passed" << std::endl; } #if BOOST_ENABLED