Search code examples
reigen

RcppEigen and Vectorization


In Eigen FAQ it states that you need to enable vectorization in the compiler.

I am trying to develop an R package using RcppEigen. I would like it if the user would have the best performance without having to manually compile the package with specified flags.

What is best practice for an R package looking to enable vectorization in the Eigen library?


Solution

  • Do exactly what the FAQ says and set the compiler flags. You may have to turn those on from a script configure after you test what the current compiler supports -- and CRAN may still tell you that the flags are not portable.

    Also, just to fix terms here, there is no "library" here in our: RcppEigen only uses headers from Eigen which is designed as a templated header-only package.