Altera_Forum
Honored Contributor
7 years agowrite to same cacheline by different kernels
Hello :),
I have a question about possible inconsistency in writing into neighbor global memory addresses by different writers (kernels). suppose two kernels have write access to same array on global memory, and they write to adjacent addresses which fall into same cache line. Since each kernel has its own copy of cache line and updates its own copy, when the cache lines are updated to the global memory, doesn't this cause inconsistency? is there any cache consistency protocol implemented in Altera OpenCL? I think one solution is to remove "restrict" keyword or put "volatile" keyword for that variable, which removes variable cache. But with this solution, even if consistency is guaranteed, the performance drops. Thanks