Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7260 Discussions

DGESVD Access Violation for m>n particular values

sragner
Beginner
689 Views

This testprogram creates an access violation under VS C++ 6.0 with MKL 8.0.1

The values 350x320 is important while for some combinations of sizes it works correctly

For example: 350x220 is faulty, 350x219 is ok, 500x314 is faulty, 500x313 is ok.

What can be the problem?

char jobu = 'S';
char jobvt = 'S';
int m = 350;
int n = 320;
int minmn= m>n?n:m;
int maxmn= m>n?m:n;
double* a = new double[m*n];
double* u = new double[m*minmn];
double* s = new double[minmn];
double* vt= new double[minmn*n];
int lda = m;
int ldu = m;
int ldvt = minmn;

int info = 0;
for ( int i = 0 ; i < m*n ; i++ ) a=((double)rand())/((double)RAND_MAX);

int lwork = -1;
double* work = new double[1];
dgesvd(&jobu , &jobvt , &m , &n , a , &lda , s , u, &ldu , vt , &ldvt , work , &lwork , &info );
lwork = (int)work[0];
delete work;
work = new double[lwork];

dgesvd(&jobu , &jobvt , &m , &n , a , &lda , s , u, &ldu , vt , &ldvt , work , &lwork , &info );

0 Kudos
2 Replies
sragner
Beginner
689 Views

http://softwareforums.intel.com/en-us/forums//topic/49120

Somebody has similar problems as I see.

if I switch jobu to 'N' it works fine (obviously it doesn't calculate U).

The only solution was to complete the matrix to square form with zeros and than extract the solution from the resulting two NxN and Nx1 matrices. This is bad and waste and hack but works till there is a fix for it.

Laszlo

0 Kudos
beaupaisley
Beginner
689 Views
It appears that in version 801 both SGESVD and DGESVD (but not ZGESVD) have this problem for ill-conditioned matrices. Does anyone know if this has been fixed in subsequent MKL releases?

Beau Paisley


0 Kudos
Reply