Quote Originally Posted by monarodan
Hi All,

Notice the "fixme" in the code. Passing NULL here contradicts the functions documentation.

To answer the question that is asked, yes, we do want to allow wait event lists. As written, there is an unexpected time bomb waiting to go off for those who set up their queues to allow out of order execution. Can this please be rectified (in all 16 places) to pass "events" through to enqueueNDRangeKernel() rather than NULL in a release in the near future?

Cheers,

Dan
I thought I'd fix this in my local header by simply passing "events" in place of NULL to enqueueNDRangeKernel(). However, there was an unexpected complication. When invoking a functor with one argument as follows:

Code :
VECTOR_CLASS<Event> events;
cl::KernelFunctor func = ...;
cl::Event e = func( a1, &events );

The KernelFunctor:perator() that is matched by my compiler (VS200 is the one with two kernel args rather than the expected one kernel arg. If the default argument for the "events" parameter is removed, then the correct template function is used. Perhaps this is what the "fixme" in the code refers to?

My resolution has been to remove the default value, but this may not satisfy many users of the API as they will have to pass NULL when invoking there functors when there is no events to wait on. I would like to know how others think this should be fixed.

One possibility is to specify the events to wait on as part of binding of the KernelFunctor:

Code :
VECTOR_CLASS<Event> events;
cl::KernelFunctor func = kernel.bind( queue, cl::NDRange(...),  cl::NDRange(...), &events );
cl::Event e = func( a1 );

Thoughts?

Cheers,

Dan