supportsAVX512 {RcppXsimd}R Documentation

Determine if CPU supports AVX512 SIMD instructions

Description

Determine if CPU supports AVX512 SIMD instructions

Usage

supportsAVX512()

Value

Boolean

Examples

## Not run: 

if (supportsAVX512()) {
  Sys.setenv(PKG_CPPFLAGS = getAVX512Flags())
  Rcpp::sourceCpp(verbose = TRUE, code='
    // [[Rcpp::plugins(cpp14)]]
    // [[Rcpp::depends(RcppXsimd)]]
               
    #include <Rcpp.h>
    #include "xsimd/xsimd.hpp"
               
    // [[Rcpp::export]] 
    void demoAVX512() {
      xsimd::batch<double, 8> a(1.0);
      xsimd::batch<double, 8> b(1.0);
      Rcpp::Rcout << a << " + " << b << " = " << (a + b) << std::endl;
    }')
  demoAVX512()
} else {
  message("AVX512 is not supported")
}

## End(Not run)

[Package RcppXsimd version 7.1.6 Index]