Clean up scatter_and_gather example on device memory space.