Page 1 of 1

dgesvd question

Posted: Wed Sep 03, 2014 9:58 am
by blasteg
I'm trying to test MAGMA's dgesvd, using a 4*5 matrix.
So I have,

Code: Select all

int nb = magma_get_dgesvd_nb(n);
      int lwork=(m+n)*nb+3*m;
      work=(double*)malloc(lwork*sizeof(double));
      magma_dgesvd('S','O',m,n,d_A,m,d_S,d_U,m,d_A,m,work,lwork,&info);
All matrix with 'd_' is malloc'd on device U:m*m, S:m

My compile option is as follow

Code: Select all

nvcc -g -v -L/opt/intel/composer_xe_2013_sp1/lib/intel64 -L/opt/NVIDIA/cuda/lib64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -O3 -lpthread -lm -lcublas -lcurand -lmagma -L/opt/magma-1.4.1/lib -I/opt/magma-1.4.1/include -DHAVE_CUBLAS -DNOCHANGE gpusvdtest.cu -o test

But when executing, it returns a segmentation fault, gdb says it's on dlange in dgesvd.
The only part dgesvd uses dlange is

Code: Select all

 254  // Scale A if max element outside range [SMLNUM,BIGNUM]
255  anrm = lapackf77_dlange("M", &m, &n, A, &lda, dummy);
I'm not really sure what is the problem here... Did I give too little work memory?

P.S. I try to post the whole message or program, but keep getting flagged as spam and refused.

Re: dgesvd question

Posted: Thu Sep 04, 2014 10:20 am
by mgates3
The matrices A, U, VT should be allocated on the CPU host, not in GPU device memory. See the tester in testing/testing_dgesvd.cpp
-mark

Re: dgesvd question

Posted: Fri Sep 05, 2014 3:59 am
by blasteg
that's... pretty inconvenient. Because in my real program, the A is calculated in GPU via cuBlas, and the U it outputs needs to be processed using cuBlas also...

Thanks anyway.