I have a doubt: if I´m working with data parallel (using ClEnqueueNDRangeKernel…) and I´m launching many kernels and in some cases the data that is the input of a kernel is the output of a previous one, and all these is in a loop that is executed n times, can I be certain that the kernels will not overlap and use inconsistent data? or do I have to make something to make it work like that? Up to the moment I thought that it should be automatic as I´m not using task parallel. Thanks!!
Unless you have an out-of-order queue, the jobs queued on a single queue are guaranteed to execute in the sequence queued up and will not overlap, this includes memory transfers and kernel invocations. By default queues are in-order.
You can use events if you need to synchronise between queues, and/or are using out of order queues.
It’s not just named a ‘queue’ for fun, it is a standard ‘queue’ data type: which means FIFO ordering. Pretty basic computer science
thanks again!! yes I know but I saw it used sometimes where I thought it would not be necessary so I started to have doubts!!