IPPSortManager#

class numpy::IPPSortManager#

numpy C++ class.

Example#

#include <numpy/np_ndarray.h>
using namespace numpy;

// Use IPPSortManager
IPPSortManager obj;
// ... operations ...

Indexing / Selection#

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

View

Other Methods#

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

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

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.

get_default_backend (np_test_1_all.cpp:25367)
25357    // std::cout << "[OK] BoostInfo tests passed" << std::endl;
25358  }
25359
25360  void test_boost_config() {
25361    std::cout << "========= Testing BoostConfig ===================";
25362
25363    using namespace numpy::boost_lib;
25364
25365    // Test default backend
25366    Backend default_backend = BoostConfig::get_default_backend();
25367    // std::cout << "Default backend: "
25368      // << (default_backend == Backend::AUTO ? "AUTO" :
25369        // default_backend == Backend::BOOST ? "BOOST" : "STANDARD")
25370      // << std::endl;
25371
25372    // Test backend resolution
25373    Backend resolved_auto = BoostConfig::resolve_backend(Backend::AUTO);
25374    // std::cout << "Resolved AUTO backend: "
25375      // << (resolved_auto == Backend::BOOST ? "BOOST" : "STANDARD")
25376      // << std::endl;
resolve_backend (np_test_1_all.cpp:25374)
25364    using namespace numpy::boost_lib;
25365
25366    // Test default backend
25367    Backend default_backend = BoostConfig::get_default_backend();
25368    // std::cout << "Default backend: "
25369      // << (default_backend == Backend::AUTO ? "AUTO" :
25370        // default_backend == Backend::BOOST ? "BOOST" : "STANDARD")
25371      // << std::endl;
25372
25373    // Test backend resolution
25374    Backend resolved_auto = BoostConfig::resolve_backend(Backend::AUTO);
25375    // std::cout << "Resolved AUTO backend: "
25376      // << (resolved_auto == Backend::BOOST ? "BOOST" : "STANDARD")
25377      // << std::endl;
25378
25379    // Test should_use_boost
25380    bool use_boost = BoostConfig::should_use_boost(Backend::AUTO);
25381    // std::cout << "Should use Boost (AUTO): " << (use_boost ? "Yes" : "No") << std::endl;
25382
25383    // Verify consistency
25384    if (BoostInfo::is_runtime_available()) {
set_default_backend (np_test_1_all.cpp:25414)
25404    // Test forced STANDARD backend
25405    bool use_standard = BoostConfig::should_use_boost(Backend::STANDARD);
25406    if (use_standard) {
25407      throw std::runtime_error("Forced STANDARD backend not working");
25408    }
25409    // std::cout << "[OK] Forced STANDARD backend works" << std::endl;
25410
25411    // Test backend setting
25412    Backend original = BoostConfig::get_default_backend();
25413    BoostConfig::set_default_backend(Backend::STANDARD);
25414    if (BoostConfig::get_default_backend() != Backend::STANDARD) {
25415      throw std::runtime_error("Backend setting not working");
25416    }
25417    BoostConfig::set_default_backend(original);  // Restore
25418    // std::cout << "[OK] Backend setting works" << std::endl;
25419
25420    // std::cout << "[OK] BoostConfig tests passed" << std::endl;
25421  }
25422
25423#if BOOST_ENABLED