gpu: only add synchronization after copies from private to global that need it
gpu: only add synchronization after copies from private to global that need it

If the data written back from private memory to global memory
is not needed within the same kernel invocation and is also not overwritten,
or if it is only needed inside the same iteration of the bands where
synchronization is inserted, then there is no need to insert synchronization
after that copy.

Signed-off-by: Sven Verdoolaege <e5350bbed4977f5eb8ae1dc6abd9ae59d21ace75@kotnet.org>

Meinersbur/ppcg,nicolasvasilache/ppcg,Meinersbur/ppcg,nicolasvasilache/ppcg