How call magma_dsyevd from c++?
Posted: Tue Jun 11, 2013 7:36 pm
Hello, I'm trying to replace lapack routines in a software by the corresponding magma routines, this software is for quantum chemistry research, the soft uses dsyev routine from lapack, magma has dsyevd routine, I think that making the change is not difficult, however, I can not make the routine works well.
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:
this code does not work, no compile errors, and no errors when running the software, simply no convergence
the original call in fortran:
this is my system:
CUDA 5.0
Magma 1.3
NVIDIA GeForce GTX 480
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