weird cuda behaviour