Page 1 of 1

clmagma: magmaf_ interfaces not present in complied library

PostPosted: Tue Feb 23, 2016 8:39 am
by paoloviviani
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

Re: clmagma: magmaf_ interfaces not present in complied libr

PostPosted: Wed Feb 24, 2016 7:41 am
by mgates3
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

Re: clmagma: magmaf_ interfaces not present in complied libr

PostPosted: Thu Feb 25, 2016 5:03 am
by paoloviviani
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)

Re: clmagma: magmaf_ interfaces not present in complied libr

PostPosted: Thu Feb 25, 2016 12:10 pm
by mgates3
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