OpenCL to CUDA refactoring