Adding cuda mode