culaDeviceSgesvd cause nvcc compile error

General CULA Dense (LAPACK & BLAS) support and troubleshooting. Use this forum if you are having a general problem or have encountered a bug.

culaDeviceSgesvd cause nvcc compile error

Postby larsroholm » Sun May 22, 2011 4:55 am

Hi!

I'm trying to compile the following __device__ function with nvcc:

Code: Select all
__device__ void foo(..., int n) {
    culaDeviceFloat* A = (culaDeviceFloat*)malloc(3 * n * 9 * sizeof(culaDeviceFloat));
    int lda = 3 * n;

    // Fill A with values...
   
    culaDeviceFloat *s, *u, *vt;
    culaDeviceSgesvd('N', 'S', 3 * n, 9, A, lda, s, u, 0, vt, 9);
   
    // Do stuff with vt..
}


If I remove the line with the culaDeviceSgesvd call everything compiles and runs, if I include the line, i get:

Code: Select all
Error   1   error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2008 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -I"C:\Program Files (x86)\CULA\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include"    --keep-dir "Release" -maxrregcount=64  --machine 32 --compile    -use_fast_math  -Xcompiler "/EHsc /nologo /Ox /Zi  /MD " -o "Release\gaze_device_functions.cu.obj" "C:\Users\lr\Documents\My Dropbox\Thesis\GPUEyeTracker\GPUEyeTrackerModel\gaze_device_functions.cu"" exited with code 2.


Any ideas for solutions would be much appreciated.

Kind regards,

Lars
larsroholm
 
Posts: 2
Joined: Fri May 20, 2011 9:27 am

Re: culaDeviceSgesvd cause nvcc compile error

Postby kyle » Sun May 22, 2011 3:47 pm

CULA can't be called inside a device function.

From the looks of your code, you'll probably want to re-factor your code as a series of calls from the host. You can use the __host__ identifier if you'd like to be explicit or just remove the __device__.
kyle
Administrator
 
Posts: 301
Joined: Fri Jun 12, 2009 7:47 pm

Re: culaDeviceSgesvd cause nvcc compile error

Postby larsroholm » Mon May 23, 2011 12:29 am

Ok, that is too bad. I will have to find a different alternative then.

I am launching a number of kernels in which i need to perform SVDs of small matrices. It is not a possibility to do the SVD call from the host.
larsroholm
 
Posts: 2
Joined: Fri May 20, 2011 9:27 am

Re: culaDeviceSgesvd cause nvcc compile error

Postby kyle » Mon May 23, 2011 5:18 am

As we've mentioned in other posts, we are working on a batch interface that will allow for you to solve a number of small problems on the GPU. This will be more appropriate for your problem.
kyle
Administrator
 
Posts: 301
Joined: Fri Jun 12, 2009 7:47 pm


Return to CULA Dense Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron