IPPInfo#
-
class numpy::IPPInfo#
Configuration and system information class.
Example#
#include <numpy/np_ndarray.h>
using namespace numpy;
// Use IPPInfo
IPPInfo obj;
// ... operations ...
Indexing / Selection#
Signature |
Return Type |
Location |
Example |
|---|---|---|---|
|
std::string |
NP_IPP_CONFIG.H:133 |
|
|
std::string |
NP_IPP_CONFIG.H:156 |
|
|
std::string |
NP_IPP_CONFIG.H:109 |
Type Checking#
Other Methods#
Signature |
Return Type |
Location |
Example |
|---|---|---|---|
|
void |
NP_IPP_CONFIG.H:169 |
Code Examples#
The following examples are extracted from the test suite.
get_version (np_test_1_all.cpp:25337)
25327 // Test compile-time detection
25328 bool compiled_with_boost = numpy::boost_lib::BoostInfo::is_compiled_with_boost();
25329 // std::cout << "Compiled with Boost: " << (compiled_with_boost ? "Yes" : "No") << std::endl;
25330
25331 // Test runtime availability
25332 bool runtime_available = numpy::boost_lib::BoostInfo::is_runtime_available();
25333 // std::cout << "Runtime available: " << (runtime_available ? "Yes" : "No") << std::endl;
25334
25335 // Test version string
25336 std::string version = numpy::boost_lib::BoostInfo::get_version();
25337 // std::cout << "Version: " << version << std::endl;
25338
25339 // Verify version contains "Boost" when enabled
25340 if (compiled_with_boost) {
25341 if (version.find("Boost") == std::string::npos) {
25342 throw std::runtime_error("Version string should contain 'Boost' when enabled");
25343 }
25344 // std::cout << "[OK] Version string contains 'Boost'" << std::endl;
25345 }
25346 else {
is_compiled_with_ipp (np_test_2_all.cpp:7923)
7913 private:
7914 std::mt19937 gen;
7915
7916 public:
7917 IPPSortingTests() : gen(std::random_device{}()) {}
7918
7919 // Test IPP configuration and detection (informational only - no validation tests)
7920 void test_ipp_config() {
7921 std::cout << "========= IPP Configuration Test =======================";
7922
7923 // std::cout << "IPP compiled: " << (numpy::ipp::IPPInfo::is_compiled_with_ipp() ? "Yes" : "No") << std::endl;
7924 // std::cout << "IPP runtime available: " << (numpy::ipp::IPPInfo::is_runtime_available() ? "Yes" : "No") << std::endl;
7925 // std::cout << "IPP version: " << numpy::ipp::IPPInfo::get_version() << std::endl;
7926
7927 if (numpy::ipp::IPPInfo::is_runtime_available()) {
7928 numpy::ipp::IPPInfo::print_status();
7929 }
7930
7931 // Note: This function is informational only and doesn't throw exceptions
7932 // IPP availability is properly tested in other test functions
7933 // std::cout << std::endl;
is_runtime_available (np_test_1_all.cpp:25333)
25323 // Helper functions for testing
25324 void test_boost_info() {
25325 std::cout << "========= Testing BoostInfo ======================";
25326
25327 // Test compile-time detection
25328 bool compiled_with_boost = numpy::boost_lib::BoostInfo::is_compiled_with_boost();
25329 // std::cout << "Compiled with Boost: " << (compiled_with_boost ? "Yes" : "No") << std::endl;
25330
25331 // Test runtime availability
25332 bool runtime_available = numpy::boost_lib::BoostInfo::is_runtime_available();
25333 // std::cout << "Runtime available: " << (runtime_available ? "Yes" : "No") << std::endl;
25334
25335 // Test version string
25336 std::string version = numpy::boost_lib::BoostInfo::get_version();
25337 // std::cout << "Version: " << version << std::endl;
25338
25339 // Verify version contains "Boost" when enabled
25340 if (compiled_with_boost) {
25341 if (version.find("Boost") == std::string::npos) {
25342 throw std::runtime_error("Version string should contain 'Boost' when enabled");
print_status (np_test_1_all.cpp:25356)
25346 }
25347 else {
25348 if (version != "Boost not compiled in") {
25349 throw std::runtime_error("Version string incorrect when Boost not enabled");
25350 }
25351 // std::cout << "[OK] Boost not compiled message correct" << std::endl;
25352 }
25353
25354 // Test print_status
25355 // std::cout << "Boost status:" << std::endl;
25356 numpy::boost_lib::BoostInfo::print_status();
25357
25358 // std::cout << "[OK] BoostInfo tests passed" << std::endl;
25359 }
25360
25361 void test_boost_config() {
25362 std::cout << "========= Testing BoostConfig ===================";
25363
25364 using namespace numpy::boost_lib;
25365
25366 // Test default backend