Jacko
Jacko

Reputation: 13195

Series of clEnqueueWriteBuffer calls

If I call clEnqueueWriteBuffer four times in sequence, and I receive an event when the fourth call completes, can I assume that the three previous writes have also completed?

Upvotes: 0

Views: 96

Answers (1)

Lee
Lee

Reputation: 930

If the queue is in-order this will work. However, for maintenance reasons it might not be wise to assume that the queue is in-order. In that case you would be better off:

  • using a barrier to explicitly say that you want every preceding command to have completed
  • chaining the copy operations with events between each pair
  • or creating a marker based on the completion events of all of the copy operations

Better to design your code for the future rather than make assumptions based on the flags you've passed to your queue now.

Upvotes: 1

Related Questions