CUDA code fixed