Learn R Programming

RcppXsimd (version 7.1.6-2)

supportsAVX512: Determine if CPU supports AVX512 SIMD instructions

Description

Determine if CPU supports AVX512 SIMD instructions

Usage

supportsAVX512()

Arguments

Value

Boolean

Examples

Run this code
if (FALSE) {

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

Run the code above in your browser using DataLab