working global and shared GPU codes