Replace use of DeviceThreadToShared with thrust::copy_n.