magmaf interfaces for ZHEGVD/DSYGVD and "pure gpu" interface

Open discussion for MAGMA

magmaf interfaces for ZHEGVD/DSYGVD and "pure gpu" interface

Postby spigafi » Mon Sep 12, 2011 5:11 pm

Dear MAGMA developer,
I am evaluating to use MAGMA to port a specific kernel of a large FORTRAN application. This application (http://bit.ly/PbNZ9) already mixes CUDA explicit kernels, an ad-hoc GPU memory management and CUBLAS calls.

Fortunately, in the last version of MAGMA the routines ZHEGVD and DSYGVD have been introduced and after a "re-arrangement" of the diagonalization algorithm I am potentially able to plug MAGMA quite straightforward. However I have two questions:
  1. the routine magma_zhegvd (under "src/zhegvd.cpp") manages by itself all the memory transfers. Is there any plan to provide a function prototype where A, B, W, WORK, RWORK and IWORK are provided as pointer on memory already allocated on the device? (I would like to manage manually the data transfer to the device because some data structure may be already on the device)
  2. I do not find any magmaf_zhegvd in "control/magma_zfortran.f90" or magmaf_dsygvd in "control/magma_dfortran.f90" Is it correct? How I can easily call these MAGMA routines from a FORTRAN90 code?

Thank you very much in advance for any useful information, suggestion, hint or help.

Filippo
spigafi
 
Posts: 7
Joined: Sun Sep 11, 2011 7:22 am
Location: Dublin

Re: magmaf interfaces for ZHEGVD/DSYGVD and "pure gpu" inter

Postby Stan Tomov » Wed Sep 14, 2011 10:55 pm

Regarding the first question, we have plans to add the functionality at question. For most of the eigenproblems we have for now only the CPU interface, but for SC11 we will release the GPU interfaces (where the data is given on the GPU memory and the result will be expected on the GPU memory).
For the second question, you have to add a Fortran interface in file control/magma_zf77.cpp, e.g., by adding
Code: Select all
...
#define MAGMAF_ZHEGVD  MAGMA_FORTRAN_NAME(zhegvd,  ZHEGVD )

...
void MAGMAF_ZHEGVD(magma_int_t *itype, char *jobz, char *uplo, magma_int_t *n,
                   cuDoubleComplex *a, magma_int_t *lda,
                   cuDoubleComplex *b, magma_int_t *ldb,
                   double *w, cuDoubleComplex *work, magma_int_t *lwork,
                   double *rwork, magma_int_t *lrwork,
                   magma_int_t *iwork, magma_int_t *liwork, magma_int_t *info)
{
  magma_zhegvd( *itype, jobz[0], uplo[0], *n,
                a, *lda, b, *ldb,
                w, work, *lwork,
                rwork, *lrwork,
                iwork, *liwork, info);
}

Also, in file control/magma_zfortran.f90 you have to add
Code: Select all
     subroutine magmaf_zhegvd( itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, lr\
work, iwork, liwork, info)
       integer       :: itype
       character     :: jobz
       character     :: uplo
       integer       :: n
       complex*16    :: a(*)
       integer       :: lda
       complex*16    :: b(*)
       integer       :: ldb
       double precision:: w(*)
       complex*16    :: work(*)
       integer       :: lwork
       double precision:: rwork(*)
       integer       :: lrwork
       integer       :: iwork(*)
       integer       :: liwork
       integer       :: info
     end subroutine magmaf_zhegvd

We will add the missing FORTRAN function interfaces in the next release (before SC11).
Stan Tomov
 
Posts: 253
Joined: Fri Aug 21, 2009 10:39 pm

Re: magmaf interfaces for ZHEGVD/DSYGVD and "pure gpu" inter

Postby spigafi » Thu Sep 15, 2011 4:32 am

Many thanks Stan for your answer!

Filippo
spigafi
 
Posts: 7
Joined: Sun Sep 11, 2011 7:22 am
Location: Dublin


Return to User discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron