I have a pipeline of kernels:
1) kernel A writes data into buffer X
2) buffer X is copied to host via clEnqueueReadBuffer
3) host data is processed, in callback triggered by clEnqueueReadBuffer
repeat above
Buffer X is created with the following flags :
CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE; | CL_MEM_HOST_READ_ONLY
My question: once clEnqueueReadBuffer is complete (I have an event triggered by CL_COMPLETE), is it safe for kernel A to run again
without overwriting data being processed on the host ?
Or should I process the data on the host before I allow kernel A to run again?
Because I am seeing a bug in my code indicating that it is not safe for kernel A to run until I process the data on the host.
Thanks!
.