OpenCL Event Callback Usage

Discussion created by perhaad on Feb 8, 2011
Latest reply on Feb 10, 2011 by nou
Syntax for OpenCL Event Call-back


Hello Everyone,  I have a question regarding the usage of the clSetEventCallback. 

The call as shown below presently segfaults on my system at the 

clSetEventCallback stage before any real execution happens and the event "device_signal" gets launched

I am using a 5870 with Stream SDK 2.3 and Catalyst 11.1

I am not sure of how the syntax should be to set up a callback for when an 

event is completed.


//Setting up a callback

void CL_CALLBACK myCallback( cl_event event,  

            cl_int cmd_exec_status, void *user_data) {


// Generates data and moves it to the GPU


struct ipargs{

cl_mem ip;  int n;



//Inside my main()

cl_event device_signal;

ipargs x

//event, status and user data

cl_int errcode = clSetEventCallback( device_signal, CL_COMPLETE, (void *)&x);

I would appreciate it if anyone with experience in setting event callbacks can show the right syntax