MAGMA fallback on LAPACK implementation

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
paoloviviani
Posts: 14
Joined: Mon Nov 09, 2015 12:17 pm

MAGMA fallback on LAPACK implementation

Post by paoloviviani » Mon Dec 07, 2015 1:00 pm

Hello,
I'm looking to make a code that relies to MAGMA portable to platforms without a GPU, is it possible to make MAGMA use the standard LAPACK implementation on which is built upon (e.g. OpenBLAS) if it does not find a GPU at runtime? I would like to underline that I'm forced to do that at runtime.
Thanks!
paolo

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

Re: MAGMA fallback on LAPACK implementation

Post by mgates3 » Tue Dec 08, 2015 4:42 pm

This is not currently supported by MAGMA. It may be possible for some CPU-interface routines (where the input/output data is on the CPU, and the computation is hybrid CPU/GPU). For GPU-interface routines, this is obviously not possible, since the input/output data is on the GPU.

We will have to do some investigation. I'm not sure of the behavior of MAGMA when no GPU is installed.

-mark

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

Re: MAGMA fallback on LAPACK implementation

Post by mgates3 » Tue Dec 08, 2015 5:11 pm

Attached is a demonstration of wrapping a MAGMA call. It's not very clean, as magma_init and magma_finalize don't currently work without a CUDA GPU, but it does work.
-mark
Attachments
wrap.cpp
(1.6 KiB) Downloaded 156 times

paoloviviani
Posts: 14
Joined: Mon Nov 09, 2015 12:17 pm

Re: MAGMA fallback on LAPACK implementation

Post by paoloviviani » Wed Dec 09, 2015 10:48 am

Thanks a lot!
I'm trying to use Armadillo library to wrap Magma. I'll modify it following your example.
Thanks again,

Paolo

Post Reply