add cpu implementation for irk2 and fixed bug with time step changing at the last step