Page **1** of **1**

### HELP-MKL problems using magma_dsyevd_gpu

Posted: **Mon May 06, 2013 6:01 am**

by **luiceur**

I've gone through the code of magma_dsyevd_gpu and I've seen that internally is allocated some more device memory. I've realliced it because when incorporated to my code, I got some:

Code: Select all

`!!!! device memory allocation error (magma_dsyevd_gpu).`

I've fixed it re-ordering the allocation statements but I am also getting an annoying :

Code: Select all

` MKL ERROR: Parameter 12 was incorrect on entry to magma_dstedx `

which I cannot identify the reason so far.

My questions are, have you ever come accross a similar situation? In which situations should I get those MKL erros on magma_dstedx? how much device memory should I allowed if I have a matrix A of size NxN?

### Re: HELP-MKL problems using magma_dsyevd_gpu

Posted: **Mon May 06, 2013 10:11 am**

by **luiceur**

Well, I've found something else that might ring some bells:

The code I am working on is using MAGMA 1.2.1, however all my testing have been done usign MAGMA 1.3. When I integrated magma_dsyevd_gpu with my other code compiled with MAGMA 1.2.1, magma did not complain, but I got those errors. I said complain because under the testing folder of MAGMA 1.2.1 there is no testing file called magma_dsyevd_gp.cpp. Another thing I've noticed, debugging the code I've realized that under MAGMA 1.2.1 I was getting different lwork value using exactly the same matrix than using MAGMA 1.3. So I hardcoded lwork to the same value obtained under MAGMA 1.3 and it worked. Therefore, what it seems to be failing is quering for optimal workspace sizes. That makes magma_dstedx to give an error.

### Re: HELP-MKL problems using magma_dsyevd_gpu

Posted: **Tue May 07, 2013 1:47 pm**

by **mgates3**

Yes, there was a correction to the work space size in dsyevd_gpu in MAGMA 1.3. Always best to use the latest release, and when reporting bugs, to mention which release you are using.

-mark

### Re: HELP-MKL problems using magma_dsyevd_gpu

Posted: **Fri May 10, 2013 7:58 am**

by **luiceur**

It does not give that error in magma 1.3.0. You are right. However I do have a question that may be naive, but I cannot really understand here.

I am calculating the eigenvalues and eigenvectors of a symmetric matrix and I am comparing the results with the mkl dsyev function. The eigenvalues obtained are okay (both agree), but it is not the case with eigenvectors. Is that normal or should I get exactly the same eigenvectors using the same matrix as input? I've also noticed this issue testing against lapackf77_dsyevd function.

The way I am testing the results is pretty straight forward:

Code: Select all

```
void test_eigen (char* desc, int m, int n, double* magma, double* lapack, int lda){
int i, j;
printf( "\n %s", desc );
for( i = 0; i < m; i++ ) {
for( j = 0; j < n; j++ )
if( fabs(magma[i*lda+j*] - lapack[i*lda+j]) > 0.0005 ){
printf( "Error: magma = %g| lapack = %g \n", magma[i*lda+j], lapack[i*lda+j]);
exit(0);
}
}
printf("SUCCESFUL\n");
}
```

### Re: HELP-MKL problems using magma_dsyevd_gpu

Posted: **Fri May 10, 2013 10:02 am**

by **mgates3**

Assuming N distinct eigenvalues, the eigenvalues and eigenvectors should be the same. If there are repeated eigenvalues this may not be true.

-mark

### Re: HELP-MKL problems using magma_dsyevd_gpu

Posted: **Fri May 10, 2013 11:19 am**

by **luiceur**

For some reason, I've got a dataset of double precision values that creates eigenvectors with different values. I've tried with some others datasets and also random matrices and it seems to work, but not with this one. Eigenvalues are always okay though... I've also checked for NaN, inf or other weird values but there are none.

What could occasionate such a difference between them? Any thoughts about that?