Is write/read buffer a work on cpu or gpu side?

When I execute clEnqueueReadBuffer/clEnqueueWriteBuffer, does CPU or GPU handle the work (i.e. which device perform the copy when it is necessary)?

If CPU handle that job, what is it doing when I try to read one buffer after another. Does it wait for the first one to finish? Does it create another CPU thread to copy the data concurrently?

When I execute clEnqueueReadBuffer/clEnqueueWriteBuffer, does CPU or GPU handle the work (i.e. which device perform the copy when it is necessary)?

That is implementation-dependent. It will depend on a number of factors. It’s actually fairly complicated.

If CPU handle that job, what is it doing when I try to read one buffer after another. Does it wait for the first one to finish? Does it create another CPU thread to copy the data concurrently?

Whether it has to wait for the first one to finish or not will depend on whether the application made a blocking read or a non-blocking read. If the first read was non-blocking it’s possible that the second read will happen concurrently with the first.

Can you give me examples?

[quote:1z38s8nc]That is implementation-dependent. It will depend on a number of factors. It’s actually fairly complicated.

Can you give me examples?[/quote:1z38s8nc]

Sorry, that would be proprietary information. In any case that information would not be useful to someone writing an application.