Returning code in cuda fitter to original code