I'm doing it in the following way:
matrix.f90: is the module with all lapack routines, it contains dsyev routine, here call the new routine in c++
eigen.cpp: is the new object with magma call:
Code: Select all
cublasInit();
double aux_work[1];
magma_int_t aux_iwork[1];
magma_dsyevd( JOBZ[0], UPLO[0],
N, A, N, W,
aux_work, -1,
aux_iwork, -1,
&INFO);
magma_int_t LWORK;
magma_int_t LIWORK;
LWORK = (magma_int_t) aux_work[0];
LIWORK = aux_iwork[0];
magma_int_t LDDA = ((N + 31)/32)*32;
WORK = (double*)malloc(LWORK*sizeof(double));
IWORK = (magma_int_t*)malloc(LIWORK*sizeof(magma_int_t));
magma_dsyevd( JOBZ[0], UPLO[0],
N, A, N, W,
WORK, LWORK,
IWORK, LIWORK,
&INFO);
cublasShutdown();
the original call in fortran:
Code: Select all
call dsyev( &
COMPUTE_EIGENVALUES_AND_EIGENVECTORS, &
UPPER_TRIANGLE_IS_STORED, &
matrixSize, &
eigenVectors%values, &
matrixSize, &
eigenValues%values, &
workSpace, &
lengthWorkSpace, &
infoProcess )
CUDA 5.0
Magma 1.3
NVIDIA GeForce GTX 480