Rsassy installs a C shim plus Rust backend libraries. One backend is selected per R process.
Auto selection
backend = "auto" uses the first installed and supported
backend in this order:
wasm_simd128avx512avx2neonscalar
sassy_features()
#> <sassy_features>
#> dispatch: dynamic
#> selected backend: avx2
#> installed backends: scalar, avx2, avx512
#> supported backends: scalar, avx2
#> CPU: avx2=yes avx512f=no neon=no
#> Rust backend: avx2 (native_simd=yes)Explicit selection
Call sassy_set_backend() before any other Rsassy native
call. Backend loading is one-shot, so test another backend in a new R
process.
script <- tempfile(fileext = ".R")
writeLines(c(
"library(Rsassy)",
"sassy_set_backend('scalar')",
"print(sassy_features())"
), script)
cat(system2(file.path(R.home("bin"), "Rscript"), c("--vanilla", script), stdout = TRUE), sep = "\n")
#> <sassy_features>
#> dispatch: dynamic
#> selected backend: scalar
#> installed backends: scalar, avx2, avx512
#> supported backends: scalar, avx2
#> CPU: avx2=yes avx512f=no neon=no
#> Rust backend: portable_scalar (native_simd=no)
unlink(script)