Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

Getting Access Violation in Read

Hi I have written an OpenCL kernel and I am passing a number of arguments to it. Right now it is not doing anything, it is just suppose to print thread ids. The kernel looks like this:


When I try to execute the kernel I get following error:

Unhandled exception at 0x02e728b1 in TemplateVS10.exe: 0xC0000005: Access violation reading location 0x640323c5.

Is there some problem in setting arguments to kernel? Since it looks like that kernel is not even going inside the function. The exception comes when I wait for kernel to finish execution.

status = clWaitForEvents(1, &events[0]);


Any help would be appreciated.



#pragma OPENCL EXTENSION cl_amd_printf : enable __kernel void sphere_decoder(const int block_length, const float noise_power, __global float *block_data, const int LIST_SIZE, __global float *llr, __global float *cand_dist, __global float *cand_sym, __global float *R_re, __global float *R_im, __global float *qr_noise_re, __global float *qr_noise_im) { printf("f hello \n"); uint tid = get_global_id(0); printf("f hello %d\n",tid); }

3 Replies
Journeyman III

Just some more information:

I am using ATI Radeon 5450 and Visual Studio 2010 Professional.

I am setting global arrays like this:

status = clSetKernelArg(kernel, 6, sizeof(cl_mem), (void *)cand_sym_d);

and I am setting const arguments like this:

status = clSetKernelArg(kernel, 3, sizeof(int), (void *)&LIST_SIZE);

They look fine to me. I do not know how to go about debugging it! Is there a kernel debugger available that works with Visual Studio?


add & to cand_sym_d. you need pass pointer at mem object not object itself.


Ohhh...thanks a lot nou. I forgot that it is a struct type variable and not a float array. Thanks again!