Using cuda-memcheck with Matlab CUDA mex-files

3 views (last 30 days)
I have been able to profile Matlab CUDA mex-files by the procedure in
Now, I'm trying to use cuda-memcheck with Matlab CUDA mex-files by a procedure which is conceptually the same, but up to now I haven't been fully successful. Let me explain the problem better.
I'm concerned with the following simple kernel
__global__ void square_array(double *a, int N)
{
int idx = blockIdx.x * blockDim.x + threadIdx.x;
if (idx<N) a[idx] = a[idx] * a[idx];
}
I'm running cuda-memcheck by the following command line
cuda-memcheck "C:\Program Files\MATLAB\R2010b\bin\win64\MATLAB.exe" -nojvm -nosplash -r TestCudaMemCheck
Everything works fine. But if I artificially introduce the following error
if (idx<N) a[5000] = a[idx] * a[idx];
when the array size is less than 5000, then the Matlab window is stuck and becomes not responding.
I'm using CUDA 5.0 under Windows 7.
How could I solve the problem? Thanks in advance.

Answers (0)

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!