Cache flushing after 'clEnqueueNDRangeKernel'


After calling “clEnqueueNDRangeKernel” are the caches flushed? From my initial observation it seems on GPU L1 is flushed but L2 is not flushed. Am I correct? what happens in case of cpu?


That is entirely a function of the specific hardware and driver you’re using. Firstly, it has no effect on correctness - caches are an implementation detail that are invisible apart from their effect on performance.

If you’re asking about it from a performance/tuning point of view, you’ll need to consult the documentation for whichever piece of hardware you’re using, assuming it is even documented. It might not even be a simple answer - it could depend on things like what types of memory are being used, whether the memory has been mapped etc.