Closed nrother closed 1 year ago
I think I understand where you're coming from, but I don't agree. One main issue is that the enqueue code path is one of PyOpenCL's most cost-sensitive ones, and every convenience feature ultimately comes at a price.
Ok, that makes sense to me. It's also easy to fix in the client code (wait_for=[x for x in wait_list if x is not None]
) if one needs it. So let's close this.
If
None
is present in the list of events to wait for, a type error is raised:In this case it is of course simple to just remove the wait_for argument altogether, but the are situations where it might be useful to filter them out inside
enqueue_nd_range_kernel
. In my case I tried to build a chain of kernels that need to execute sequentially and tried to re-use the same variable for the event. In the first iteration it wasNone
and I hit this problem.The documentation for clEnqueueNDRangeKernel states that "the list of events pointed to by event_wait_list must be valid", so this would be a derivation from the OpenCL interface, but I think a useful one.