gpu: only add synchronization after copies from shared to global that require it
gpu: only add synchronization after copies from shared to global that require it

If the data written back from shared 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>

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