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:Originally Posted by monarodan
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 );