clmagma: magmaf_ interfaces not present in complied library

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

clmagma: magmaf_ interfaces not present in complied library

Postby paoloviviani » Tue Feb 23, 2016 8:39 am

Hello,
I successfully built clmagma-1.3 on my machine and tests run successfully. However, I realized that the magmaf_ fortran interfaces are not present in the resulting binaries.
I have a C++ legacy code that relies on a standard lapack API and would be cumbersome to modify it: with Magma I could use the magmaf_ interfaces to do the job, how can I compile those interfaces in this case?

Thanks in advance!
Paolo
paoloviviani
 
Posts: 14
Joined: Mon Nov 09, 2015 12:17 pm

Re: clmagma: magmaf_ interfaces not present in complied libr

Postby mgates3 » Wed Feb 24, 2016 7:41 am

At the moment, we haven't developed a means to represent the necessary data structures in Fortran. The Fortran files that are in clMAGMA are leftovers from the CUDA MAGMA version. Sorry. We'll keep this in mind for future work.
-mark
mgates3
 
Posts: 750
Joined: Fri Jan 06, 2012 2:13 pm

Re: clmagma: magmaf_ interfaces not present in complied libr

Postby paoloviviani » Thu Feb 25, 2016 5:03 am

Many thanks for the reply!
Would it be possible to write proper interfaces within my code, possibly using those in CUDA Magma as a template? Are they expected to work? (the issue is only related to converting chars like *jobz to enums)
paoloviviani
 
Posts: 14
Joined: Mon Nov 09, 2015 12:17 pm

Re: clmagma: magmaf_ interfaces not present in complied libr

Postby mgates3 » Thu Feb 25, 2016 12:10 pm

The wrappers that are in clMAGMA/control/magma_*f77.cpp will not work. They are out dated, from when magma_uplo_t, etc. were chars.

There are wrappers in CUDA MAGMA control/magma_*f77.cpp that show how to convert the char* constants to integer constants. For instance:

Code: Select all
#define magmaf_zpotrf FORTRAN_NAME( magmaf_zpotrf, MAGMAF_ZPOTRF )
void magmaf_zpotrf(
    const char* uplo, magma_int_t *n,
    magmaDoubleComplex *A, magma_int_t *lda,
    magma_int_t *info )
{
    magma_zpotrf(
        magma_uplo_const(*uplo), *n,
        A, *lda,
        info );
}


Conversion functions are provided:

Code: Select all
magma_bool_t   magma_bool_const  ( char lapack_char );
magma_order_t  magma_order_const ( char lapack_char );
magma_trans_t  magma_trans_const ( char lapack_char );
magma_uplo_t   magma_uplo_const  ( char lapack_char );
magma_diag_t   magma_diag_const  ( char lapack_char );
magma_side_t   magma_side_const  ( char lapack_char );
magma_norm_t   magma_norm_const  ( char lapack_char );
magma_dist_t   magma_dist_const  ( char lapack_char );
magma_sym_t    magma_sym_const   ( char lapack_char );
magma_pack_t   magma_pack_const  ( char lapack_char );
magma_vec_t    magma_vec_const   ( char lapack_char );
magma_range_t  magma_range_const ( char lapack_char );
magma_vect_t   magma_vect_const  ( char lapack_char );
magma_direct_t magma_direct_const( char lapack_char );
magma_storev_t magma_storev_const( char lapack_char );


Currently for clMAGMA, you will also need to pass in queues to most routines. You could allocate & deallocate them in your wrappers, which adds some overhead. Or you could allocate & deallocate them in your application code and pass them to your wrappers.

-mark
mgates3
 
Posts: 750
Joined: Fri Jan 06, 2012 2:13 pm


Return to User discussion

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron