Fix magic functions in generated CUDA code.