Replace call to DeviceSharedToThread with thrust::copy_n.