Porting a function from lapack to magma

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
splendor
Posts: 1
Joined: Wed May 20, 2020 8:22 pm

Porting a function from lapack to magma

Post by splendor » Wed May 20, 2020 8:29 pm

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

kerry87
Posts: 8
Joined: Wed May 20, 2020 11:34 am
Contact:

Re: Porting a function from lapack to magma

Post by kerry87 » Thu May 21, 2020 5:52 am

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!

mgates3
Posts: 918
Joined: Fri Jan 06, 2012 2:13 pm

Re: Porting a function from lapack to magma

Post by mgates3 » Thu May 21, 2020 9:34 am

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

Post Reply