Learn R Programming

RcppXsimd (version 7.1.6-2)

supportsNEON: Determine if CPU supports NEON SIMD instructions

Description

Determine if CPU supports NEON SIMD instructions

Usage

supportsNEON()

Arguments

Value

Boolean

Examples

Run this code
if (FALSE) {

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

Run the code above in your browser using DataLab