Registered Member
|
Dear all,
I am unable to use OpenMP on MacOS X (for valid reasons), so I am trying to understand if I can use the multithreaded routines in the Accelerate framework (BLAS/LAPACK) with Eigen classes. Thanks for any suggestions! |
Moderator
|
with the devel branch you can use whatever BLAS: -DEIGEN_USE_BLAS -framework Accelerate
For LAPACK, the interface is currently partly limited to MKL, but generalizing it to any LAPACK should be straightforward,basically it consists in reproducing the changes that has been required for BLAS: https://bitbucket.org/eigen/eigen/commits/daf3e6a2b870 to LAPACK interface files: Eigen/src/Cholesky/LLT_MKL.h Eigen/src/Eigenvalues/RealSchur_MKL.h Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h Eigen/src/Eigenvalues/ComplexSchur_MKL.h Eigen/src/QR/ColPivHouseholderQR_MKL.h Eigen/src/QR/HouseholderQR_MKL.h Eigen/src/LU/PartialPivLU_MKL.h Eigen/src/SVD/JacobiSVD_MKL.h If you're willing to give some help, I guess I can try to update Eigen/src/Cholesky/LLT_MKL.h, and then let you reproduce the changes... |
Registered Member
|
That would be awesome, if you let me know I will make that work, if I can!
|
Registered Member
|
|
Moderator
|
I made it a blocker for 3.3: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=173
|
Moderator
|
|
Registered Member
|
... but it doesn't work. It seems Eigen now requires the LAPACKE C interface, but the Accelreate framework only provides the CLAPACK C interface. So Eigen does *not* (and is not planned to?) work with Apple's Accelerate framework. Or do I misunderstand something? |
Moderator
|
$ sudo port install lapack
and then link to /opt/local/lib/lapack/liblapacke.dylib This is just a thin layer, and accelerate will be used under the hood, see:
|
Registered Member
|
Thanks for the hint. However, on my system this seems not to be a thin wrapper around the Accelerate framework at all. But, I also compiled `liblapacke.a` from the netlib sources directly (into ~/local/lib/lapack/liblapacke.a), and this does seem to work as desired when linking with the Accelerate framework.
Here is what I get for the Cholesky benchmark in the various versions: 1. without external BLAS/LAPACK:
2. with liblapacke.a compiled from netlib sources and -framework Accelerate:
3. with liblapacke.dylib from the the lapack port and -framework Accelerate:
|
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]