supportsNEON {RcppXsimd}R Documentation

Determine if CPU supports NEON SIMD instructions

Description

Determine if CPU supports NEON SIMD instructions

Usage

supportsNEON()

Value

Boolean

Examples

## Not run: 

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

## End(Not run)


[Package RcppXsimd version 7.1.6 Index]