Page 1 of 1
Porting a function from lapack to magma
Posted: Wed May 20, 2020 8:29 pm
by splendor
I am trying to use MAGMA in order to "dgesdd_" of Lapack call to "dgesdd" to Magma call.
I installed the magma in my local environment.
What I have done exactly is 1- #include "magma_d.h" and change function name from "dgesdd_" to "magma_dgesdd". Afaik, the function parameters are the same.
What am I missing and what should I do?
I hope someone can help me
Thanks
Re: Porting a function from lapack to magma
Posted: Thu May 21, 2020 5:52 am
by kerry87
Do you know if there is possible to use some containerized env to make it work? for example, using a docker container, which will contain all needed (SO, libs, etc)? thanks!
Re: Porting a function from lapack to magma
Posted: Thu May 21, 2020 9:34 am
by mgates3
As shown in example/example_v2.c, you should include magma_v2.h.
Then replace LAPACK dgesdd_ with magma_dgesdd. The job parameter changes from a string to an enum. The dimensions change from int pointers to plain ints. I highly suggest doing a workspace query, as LAPACK and MAGMA will have different workspace size requirements.
dgesdd_( "some", &m, &n, A, &lda, ... )
becomes
magma_dgesdd( MagmaSomeVec, m, n, A, lda, ... )
Then link with the MAGMA, LAPACK, cuBLAS, and CUDA libraries.
From your post, it's unclear what difficulties you may be having — code isn't compiling, or it isn't linking, or it crashes when running, or gets the wrong answer. Please post exactly what you did and what went wrong.
Mark