Starting to optimize CUDA stuff