by nchilton » Thu Apr 12, 2012 7:47 pm
Thanks Mathieu!
My code is indeed f90, so I will re-compile PLASMA with the PLASMA_F90 = 1 option set. I assume then instead of the include statement, I'll need:
use plasma
use plasma_d (and any other data types I need)
Then in the code, do I still need to call the PLASMA_INIT, PLASMA_ALLOC_WORKSPACE_DSYEV, PLASMA_DEALLOC_HANDLE and PLASMA_FINALIZE as well as the PLASMA_DSYEV call?
EDIT: Also, having looked at the df90 subroutines:
subroutine PLASMA_Alloc_Workspace_dsyev(M,N,descT,info)
use iso_c_binding
implicit none
integer(kind=c_int), intent(out) :: info
integer(kind=c_int), intent(in) :: M
integer(kind=c_int), intent(in) :: N
type(c_ptr) :: descT ! descT is **, so pass by reference
info = PLASMA_Alloc_Workspace_dsyev_c(M,N,descT)
end subroutine PLASMA_Alloc_Workspace_dsyev
subroutine PLASMA_dsyev(jobz,uplo,N,A,LDA,W,T,Q,LDQ,info)
use iso_c_binding
implicit none
integer(kind=c_int), intent(out) :: info
integer(kind=c_int), intent(in) :: LDA
integer(kind=c_int), intent(in) :: LDQ
integer(kind=c_int), intent(in) :: N
integer(kind=c_int), intent(in) :: jobz
integer(kind=c_int), intent(in) :: uplo
real(kind=c_double), intent(inout), target :: A(LDA,*)
real(kind=c_double), intent(out), target :: W(*)
real(kind=c_double), intent(out), target :: Q(LDQ,*)
type(c_ptr), value :: T ! Arg managed by PLASMA: opaque to Fortran
info = PLASMA_dsyev_c(jobz,uplo,N,c_loc(A),LDA,c_loc(W),T,c_loc(Q),LDQ)
end subroutine PLASMA_dsyev
What type of argument do I use for 'T'? A dummy integer or string?
Cheers, Nick