Start of CUDA implementation