Changed convergenceThreshold to float, added const to various functions, fixed some cuda device numbers