Take the 2-minute tour ×

Please see below code:

thrust::device_vector<int>::iterator whereToBegin = copyListOfNgramCounteachdoc.begin();
end = thrust::unique_by_key(end.first, end.first + numUniqueNgrams,end.second);
thrust::device_vector<int>::iterator end1 = end.first;
thrust::device_vector<int>::iterator iter;
for(iter = whereToBegin; iter!=end1; iter++){

The question is really simple. How do i print the value that iter points at.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

In your host code:


Just like standard containers.

share|improve this answer
Thanks. I will be obliged if you could also look at my question thrust::unique_by_key eating up last element and let me know if you see anything funny –  Programmer Jun 17 '12 at 21:24
I will accept your answer in 6 minutes :D –  Programmer Jun 17 '12 at 21:24
add comment

Your Answer


