solved cpu and gpu output inconsistency