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

### CULA R11 errors cf. LAPACK

Posted:

**Wed May 25, 2011 9:24 pm**
by **gusgw**

Hi there,

I'm using the cula_zheev and lapack zheev routines to diagonalize a hermitian matrix in my code. I have found some significant differences (enough to ruin the calculations) in the returned eigenvalues between CULA R11 (and R10) and LAPACK. I have verified that the matrix being fed to both routines is identical.

I have attached an excel spreadsheet displaying these differences. I will try replicate this error with smaller matrices.

Nick

### Re: CULA R11 errors cf. LAPACK

Posted:

**Thu May 26, 2011 1:20 pm**
by **john**

If you have matrix data in binary format, then we will have a look at it. One thing to expect is that eigenvalues will differ slightly between LAPACK implementations and due to different algorithms. (Even though eignvalues are unique to a matrix). A good test of the quality of computed eigenvalues is to check the closeness of A*VR = VR*W. You should not expect that two different implementations are within machine epsilon of one another. If the matrix was constructed specifically to have known eigenvalues, then you could check the results of CULA vs those.

### Re: CULA R11 errors cf. LAPACK

Posted:

**Thu May 26, 2011 7:33 pm**
by **gusgw**

Unfortunately, I only have the matrix in ASCII format. I can upload this if it is useful. This matrix was not designed to have known eigenvalues, unfortunately. I'm unfamiliar with the test of A*VR=VR*W, could you please describe it? Is this just the eigenvalue equation?

I have tried the diagonalization with cula_zheevx with abstol set to two times the machine underflow, but this produces identical results to the regular cula_zheev routine.

### Re: CULA R11 errors cf. LAPACK

Posted:

**Fri May 27, 2011 5:47 am**
by **kyle**

ASCII format is fine as long as there is no loss in precision.

For the eigenvalue test, John was simply describing the eigenvalue definition:

A * (eigenvectors) = (diagonal of eigenvalues) * (eigenvectors)

### Re: CULA R11 errors cf. LAPACK

Posted:

**Fri May 27, 2011 8:31 pm**
by **gusgw**

Sure, I will do the eigenvalue test later today and report for both LAPACK and CULA.

The input matrix is attached as matrix.txt inside matrix.rar, with values printed as real and imaginary parts in pairs, i.e. the file is 750*375, where each row contains 375 pairs;

Re[1,1] Im[1,1] Re[1,2] Im[1,2] ....

Re[2,1] Im[2,1] Re[2,2] Im[2,2] ....

....

Each value is printed to 18 places, which should be greater than machine precision.

Let me know if anything needs to be altered in terms of the format.

Cheers!

N

### Re: CULA R11 errors cf. LAPACK

Posted:

**Tue May 31, 2011 8:30 am**
by **kyle**

I was able to import your matrix into our testing system and I'm not seeing any significant errors in accuracy when performing identity tests,

norm( MKL) = 2.57847e-034

norm( CULA ) = 3.48469e-034

where the norms are calculated by: norm( A*V - V*E ).

I've also ported the matrix to MATLAB format for some quick testing as well (attached).

### Re: CULA R11 errors cf. LAPACK

Posted:

**Tue May 31, 2011 11:37 pm**
by **gusgw**

Thank you for testing the matrix, I'm yet to calculate the norms, but I will do so and report.

I have some good news however! I have just installed cuda 4 and cula R12 and the returned eigenvalues are indeed closer to lapack (average relative error for R12 compared with lapack is 5.37E-4, and R10/R11 was 2.47E-3). See the attached spreadsheet.

I will calculate norms and get back to you.