Disable or flush cache inside GPU


I’m playing with Carrizo APU (GCN3) and trying to find a way to remove the cache coherency within GPU (L2 cache is synchronization point for GPU) so that GPU’s update is visible to CPU without tearing down the wavefront or kernel.

Is there any OpenCL API or assembly instruction that can either flush L2 cache or disable caching in GPU? (I found that there are GCN instructions to flush L1 cache but not L2)

Thank you!

Fine-grained SVM-buffer with atomics support is the answer. Unfortunately, atomics are only available under Linux (I’m not enitrely sure about Carrizo).