Replace some inefficient operations with relatively efficient ones.

This modification makes the performance of using Unified Memory
more meaningful.