Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

clapack interface and mkl

Petros_Mamales
Beginner
477 Views
Hi,
Being a c++ programmer, I got tired of transating the lapack calls into c++ template functions and decided to make use of an already existing library, namely lapack bindings, that connects lapack calls to boost ublas structures (classes).
These are header-only "libraries", that allow for a clapack interface of the lapack functions. In particular, no need is there, to use a clapack library (i.e. .lib).
I was thinking therefore, to include numeric bindings in my code and link everything with mkl.
I was wondering, therefore, if the c interface of mkl's lapack and the one from clapack, are identical
(or, compatible in case some type-promotions are to be allowed).
Thank you in advance for your help,
Petros
0 Kudos
4 Replies
Konstantin_A_Intel
477 Views
Hi Petros,
Intel MKL supports LAPACKE that is C LAPACK extention interface. As far as I know, this interfaces is aligned w/ NETLIB version of LAPACKE.
BTW, it was recently announced that Eigen C++ package now supports MKL backend. So, you can consider this as an alternative library for highly abstracted C++ computations.
Regards,
Konstantin
0 Kudos
Petros_Mamales
Beginner
479 Views
Hi Konsantin,
The problem w/ Eigen is that it does not allow for using your own allocator with the matrix containers, forbidding me from using a thread-scallable allocator.
However, as far as I understand CLAPACK is a LAPACK "passed through f2c". I guess my question is if the mkl interface is the one that would be obtained by doing exactly this and if this is guaranteed to be so.
Thank you for yor help,
Petros
0 Kudos
Alexander_K_Intel3
479 Views
Hi Petros,

The CLAPACK has exactly the same interface like the Fortran LAPACK, where all parameters are passed by reference. And this is exactly the interface MKL provides for all variants of names bindings like dgetrf DGETRF dgetrf_ DGETRF. Just take care of integers size if you are on 64bit architecture: use lp64 for 4byte integers and ilp64 for 8byte integers.

And just in case MKL also provides additional interfaces. One of these is LAPACKE. which supposed to be more in C style: withnon vector input parameters passed by value and possibility to not worry about workspaces, plus support of column major storage. This is whatKonstantin talked about.

W.B.R.,
Alexander
0 Kudos
Petros_Mamales
Beginner
479 Views
Hi Alexander,
Thank you very much for your response.
W.B.R.
P-
0 Kudos
Reply