CUDA fixing code