Description Usage Value Examples
Determine if CPU supports AVX SIMD instructions
1 |
Boolean
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
if (supportsAVX()) {
Sys.setenv(PKG_CPPFLAGS = getAVXFlags())
Rcpp::sourceCpp(verbose = TRUE, code='
// [[Rcpp::plugins(cpp14)]]
// [[Rcpp::depends(RcppXsimd)]]
#include <Rcpp.h>
#include "xsimd/xsimd.hpp"
// [[Rcpp::export]]
void demoAVX() {
xsimd::batch<double, 4> a(1.0);
xsimd::batch<double, 4> b(1.0);
Rcpp::Rcout << a << " + " << b << " = " << (a + b) << std::endl;
}')
demoAVX()
} else {
message("AVX is not supported")
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.