b) Is likely some issue with your code. OpenCL.Net runs through all variations of clEnqueueNDRangeKernel with event lists, no event lists and event outputs in its unit tester and has no issues.
SetEventCallback works there as well.
Originally posted by: nythrix Hi,
I'm the maintainer of the Cloo project (http://sourceforge.net/projects/cloo/). After upgrading my ATI Stream installation to v2.2 (from v2.01), two things stopped working:
a) clBuildProgram() if a notify function is given (works with null) and
You need to add "CL_CALLBACK" to the function definition. For example:
static void CL_CALLBACK notify_callback(...)
If you look in the header files, you will see:
extern CL_API_ENTRY cl_int CL_API_CALL
clBuildProgram(cl_program /* program */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const char * /* options */,
void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
void * /* user_data */) CL_API_SUFFIX__VERSION_1_0;
And in cl_platform.h you will find:
#define CL_API_CALL __stdcall
#define CL_CALLBACK __stdcall
Note that on Windows with ATI, the callbacks are currently cdecl, but will most likely change to stdcall at some point:
Indeed, changing from UnmanagedFunctionPointer(CallingConvention.Cdecl) to StdCall does work in both cases (clBuildProgram and clSetEventCallback).
Also clEnqueueNDRange is mysteriously working again. And I never touched it. I must've hit a weak spot in the drivers running the tests one after another. Very odd...
Much appreciated, guys. You've been very helpful indeed!