How to call from Fortran

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
jrm4412
Posts: 5
Joined: Wed Nov 05, 2014 11:29 pm

How to call from Fortran

Post by jrm4412 » Fri Nov 07, 2014 5:56 pm

So, I've got MAGMA 1.5 up and running with Intel compilers/MKL 11.2 and Cuda 6.5 on a Tesla C2050 gpu. Unfortunately, I'm having trouble calling magma functions from Fortran.

I've made my own wrapper with C to call magma from Fortran, but I'm having some trouble and get this error: "cannot bind [matrix A] to texture: unknown error (30)". I can post the details of my code, but I'm wondering: is there any easier way to call magma from Fortran?

Many thanks.

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

Re: How to call from Fortran

Post by mgates3 » Mon Nov 10, 2014 11:21 am

Can you provide some more details about what exact MAGMA functions you are calling, and how you calling that - how you are allocating memory and such. A snippet of your Fortran code would be great.

There are Fortran wrappers already in MAGMA. These are defined in control/magma_*f77.cpp and control/magma_*fortran.F90. Basically the same arguments as the C routine, but with magmaf_ prefix instead of magma_. The F90 modules (*.mod) should be in the include folder after compiling MAGMA.

-mark

jrm4412
Posts: 5
Joined: Wed Nov 05, 2014 11:29 pm

Re: How to call from Fortran

Post by jrm4412 » Fri Nov 14, 2014 6:51 pm

Thanks, Mark. I did have success using the Fortran wrappers that were provided. For ones that were not available (eg blas routines), I essentially rewrote the Cublas fortran_thunking interface to work with magma functions. I also added wrappers for init and finalize.

Post Reply