30.07.2015 Views

Slides - Par Lab

Slides - Par Lab

Slides - Par Lab

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" Iterators act like pointers// declare iterator variablesdevice_vector::iterator begin = d_vec.begin();device_vector::iterator end = d_vec.end();// pointer arithmeticbegin++;// dereference device iterators from the hostint a = *begin;int b = begin[3];// compute size of range [begin,end)int size = end - begin;© 2011 NVIDIA Corporation 50/73

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

Saved successfully!

Ooh no, something went wrong!