PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Need some help in linking Magma
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
Ragavan



Joined: 30 May 2012
Posts: 7

PostPosted: Fri Jun 08, 2012 8:00 am    Post subject: Parameter Error Reply with quote

Hi Matt,

I am getting a parameter error for the magma interface. I have tried integer*8 as an input variable too.

Here`s my new code:

MAGMA INTERFACE

module magmafor
interface dsygvdmagma
subroutine dsygvdDev (ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK, &
LWORK,IWORK, LIWORK, INFO) bind (c, name = 'magma_dsygvd')
use iso_c_binding
IMPLICIT NONE
!integer(c_int) :: ITYPE, N, LDA, LDB, LWORK, LIWORK, INFO
integer*4 :: ITYPE, N, LDA, LDB, LWORK, LIWORK, INFO
character(kind = c_char) :: JOBZ, UPLO
double precision(c_double) :: A(LDA,N), B(LDA,N), W(N), WORK(LWORK)
integer(c_int) :: IWORK(LIWORK)
end subroutine dsygvdDev
end interface
end module magmafor

program main

use magmafor

INTEGER NIN, NOUT
PARAMETER (NIN=5,NOUT=6)
INTEGER :: NB, NMAX
PARAMETER (NB=64,NMAX=10)
INTEGER*4 :: ITYPE,itype4,LDA, LDB, LIWORK, LWORK, error
integer*8 :: itype8
PARAMETER (ITYPE=2,LDA=NMAX,LDB=NMAX,LIWORK=3+5*NMAX,&
LWORK=1+(6*NMAX*NB+2*NMAX*NMAX))

DOUBLE PRECISION :: A(LDA,NMAX), B(LDA,NMAX), &
W(NMAX), WORK(LWORK)

integer :: IWORK(LIWORK)

open(NIN,file='dsygvd.dat',form='formatted')
WRITE (NOUT,*) 'DSYGVD Example Program Results'
WRITE (NOUT,*)

! Skip heading in data file
READ (NIN,*)
READ (NIN,*) N
IF (N.LE.NMAX) THEN

! Read the upper triangular parts of the matrices A and B

READ (NIN,*) ((A(I,J),J=I,N),I=1,N)
READ (NIN,*) ((B(I,J),J=I,N),I=1,N)

!call DSYGVD(ITYPE,'V','U',N,A,LDA,B,LDB,W,WORK,LWORK,IWORK,LIWORK,INFO)

!IF (INFO.EQ.0) THEN
!
! Print solution
!
!WRITE (NOUT,*) 'Eigenvalues'
!WRITE (NOUT,99999) (W(J),J=1,N)
!WRITE (NOUT,*) 'Eigenvectors'
!WRITE (NOUT,99999) ((A(I,J),J=1,N),I=1,N)

!END IF
! Magma call

itype2=2
itype4=2
itype8=2

call dsygvdmagma(itype4,'V','U',N,A,LDA,B,LDB,W,WORK,LWORK,IWORK,LIWORK,INFO)

LWOPT = WORK(1)
LIWOPT = IWORK(1)
!

IF (INFO.EQ.0) THEN
!
! Print solution
!
WRITE (NOUT,*) 'Eigenvalues'
WRITE (NOUT,99999) (W(J),J=1,N)
WRITE (NOUT,*) 'Eigenvectors'
WRITE (NOUT,99999) ((A(I,J),J=1,N),I=1,N)

END IF

! Print workspace information
!
IF (LWORK.LT.LWOPT) THEN
WRITE (NOUT,*)
WRITE (NOUT,99995) 'Optimum workspace required = ', LWOPT, &
'Workspace provided = ', LWORK
END IF
IF (LIWORK.LT.LIWOPT) THEN
WRITE (NOUT,*)
WRITE (NOUT,99995) 'Integer workspace required = ', LIWOPT, &
'Integer workspace provided = ', LIWORK
END IF
ELSE
WRITE (NOUT,*) 'NMAX too small'
END IF

99999 FORMAT (3X,(6F11.4))
99998 FORMAT (4X,1P,6E11.1)
99997 FORMAT (1X,A,I4,A)
99996 FORMAT (1X,A,I4)
99995 FORMAT (1X,A,I5,/1X,A,I5)
end program


Makefile:

FORT = pgfortran
PGIFLAGS = -Mcuda
TGT = magmatest3
CUDADIR = /sw/keeneland/cuda/4.0/linux_binary/
MAGMALIB = /sw/keeneland/magma/1.1/centos5.5_gnu4.4/magma_1.1.0/lib
#LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lcublas -lm
CUDADIR = /sw/keeneland/cuda/4.0/linux_binary
MKLROOT = /opt/intel/composer_xe_2011_sp1.8.273/mkl
#LIBDIR = -L/opt/intel/Compiler/11.1/038/lib/intel64 -L$(MKLROOT)/lib/em64t \

LIBDIR = -L/opt/intel/composer_xe_2011_sp1/lib/intel64 -L$(MKLROOT)/lib/intel64 -L$(CUDADIR)/lib64
LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lcublas -lm
PGILIB = -lmkl_intel_lp64 -lmkl_pgi_thread -lmkl_core -mp -lpthread -lm -pgf90libs -lcublas -lcudart -lm

INCD = -mp -pgf90libs -I$(MKLROOT)/include
$(TGT): $(TGT).f90
$(FORT) -g $(PGIFLAGS) -c $<
$(FORT) $(INCD) -g $(PGIFLAGS) -o $@ $@.o -L$(MAGMALIB) -lcuda -lmagma -lmagmablas -lmagma $(LIBDIR) $(PGILIB)
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group