Some modifications for CUDA