[cutorch refactor] move std function into generic
6 files changed