Sunday, 15 September 2013

Standard Fortran interface for cuBLAS

Standard Fortran interface for cuBLAS

I am using a commercial simulation software on Linux that does intensive
matrix manipulation. The software uses Intel MKL by default, but it allows
me to replace it with a custom BLAS/LAPACK library. This library must be a
shared object (.so) library and must export both BLAS and LAPACK standard
routines. The software requires the standard Fortran interface for all of
them.
To verify that I can use a custom library, I compiled ATLAS and linked
LAPACK (from netlib) inside it. The software was able to use my compiled
ATLAS version without any problems.
Now, I want to make the software use cuBLAS in order to enhance the
simulation speed. I was confronted by the problem that cuBLAS doesn't
export the standard BLAS function names (they have a cublas prefix).
Moreover, the library cuBLAS library doesn't include LAPACK routines. I
use readelf -a to check for the exported function.
On another hand, I tried to use MAGMA to solve this problem. I succeeded
to compile and link it against all of ATLAS, LAPACK and cuBLAS. But still
it doesn't export the correct functions and doesn't include LAPACK in the
final shared object. I am not sure if this is the way it is supposed to be
or I did something wrong during the build process.
I have also found CULA, but I am not sure if this will solve the problem
or not.
Did anybody tried to get cuBLAS/LAPACK (or a proper wrapper) linked into a
single (.so) exporting the standard Fortran interface with the correct
function names? I believe it is conceptually possible, but I don't know
how to do it!

No comments:

Post a Comment