I'm looking at the clEnqueueWaitForEvents()
OpenCL API function.
As I see it, this is a real boon. You see, almost all clEnqueueXXX functions take an array-of-events, and the size of that array, to wait for, before executing the other command. That is silly, and I might go as far as saying ridiculously redundant and unnecessarily coupled, API design. Instead, the API should let you enqueue a wait for a bunch of events, without anything else, after which you would enqueue whatever other command/action you wanted, without any waiting. ... and indeed, we can do this - with clEnqueueWaitForEvents()
.
So, why was this function deprecated, rather than deprecating the redundant arguments of all of the rest of the enqueue functions?
PS - It should probably be mentioned that in CUDA, that's the way it works; or rather, you enqueue waits on individual events, an even thinner 'quantum' of enqueing things (cuStreamWaitEvent()
)
I cannot say for certain what the reasoning was behind the depreciation, but seeing as clEnqueueBarrierWithWaitList()
was added at the same time, it was likely just renamed to clean up the API and avoid confusion with clWaitForEvents()
. The only difference between clEnqueueBarrierWithWaitList()
and clEnqueueWaitForEvents()
that I can see is that clEnqueueBarrierWithWaitList()
adds the ability to create an event that allows querying the status of the barrier.