allow code to be easily ported back to CUDA