none
Is there a simple way to make RcppEigen use the MKL via MRO ? RRS feed

  • Question

  • Hello,

    I found out that RcppArmadillo uses the MKL without specifying any option when using MRO.

    Yet, RcppEigen don't.

    For example:

    n <- 2e3
    M <- matrix(rnorm(n*n), n)
    
    print(system.time(M %*% M)[3])       # 0.19
    print(system.time(prodArma(M))[3])   # 0.19
    print(system.time(prodEigen(M))[3])  # 1.18

    with simple functions (this is just for illustration):

    void prodEigen(Map<MatrixXd> M) {
      MatrixXd tmp = M * M;  
      return;
    } 
    void prodArma(const mat& M) {
      mat tmp = M * M;  
      return;
    } 

    We can see that R product and Armadillo product make use of the MKL but Eigen product doesn't.

    Is there a simple way to make RcppEigen use the MKL via MRO ?

    Note that I use the latest version of MRO.

    Sincerely,

    Florian.

    Monday, July 11, 2016 7:57 PM

All replies

  • I would suggest that you post this question to the RcppEigen forum, as this question is best answered by the author of the RcpEigen package. If the RcppEigen package makes use of of the libraries Rblas and Rlapack included with MRO and CRAN-R, then it can use MKL, otherwise it can't.

    You can find the 'RcppEigen' forum here:

    https://forum.kde.org/viewforum.php?f=74

    Stephen Weller

    Friday, July 22, 2016 8:33 PM