20.01.2015 Views

include

include

include

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Iterators<br />

Iterators act like pointers<br />

// allocate device vector<br />

thrust::device_vector d_vec(4);<br />

thrust::device_vector::iterator begin = d_vec.begin();<br />

thrust::device_vector::iterator end = d_vec.end();<br />

int length = end - begin; // compute size of sequence [begin, end)<br />

end = d_vec.begin() + 3; // define a sequence of 3 elements<br />

begin<br />

end<br />

© 2008 NVIDIA Corporation<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!