[Recorded] a problem using opencl under macos, clSetEventCallback not take effect

Calling sequence beginning is this:
enqueueWriteBuffer
enqueueNDRangeKernel
enqueueReadBuffer
SetEventCallback

After executing the main program waits with getchar (), but the callback function is not triggered.

Modify the function call sequence:
SetEventCallback
enqueueWriteBuffer
enqueueNDRangeKernel
enqueueReadBuffer

Function error CL_INVALID_EVENT -58

Modified to not being given in the following order, but still the callback function is not triggered:
enqueueWriteBuffer
SetEventCallback
enqueueNDRangeKernel
enqueueReadBuffer

Visible event objects must be referenced once, in order to set a callback.
Callback unknown reason can not continue to be tested on other platforms.

Guess you like

Origin www.cnblogs.com/ahfuzhang/p/11572240.html