Moved cuda error checking functions into DEM class