If you have a device_vector that you need to process more on, try saving the data on the device and processing it using Thrust algorithms or your own kernels. If you need to read only a few values โโfrom device_vector, just access the values โโdirectly using parenthesized notation. If you need to access multiple values, copy device_vector to host_vector and read the values โโfrom there.
thrust::device_vector<int> D; ... thrust::host_vector<int> H = D;
source share