manipulate computation for grad, U, and diff to avoid a thrust transform