boost::compute::iota
// In header: <boost/compute/algorithm/iota.hpp> template<typename BufferIterator, typename T> void iota(BufferIterator first, BufferIterator last, const T & value, command_queue & queue = system::default_queue());
Fills the range [first, last) with sequential values starting at value.
first
last
value
For example, the following code:
boost::compute::iota(vec.begin(), vec.end(), 0, queue);
Will fill vec with the values (0, 1, 2, ...).
vec
0
1
2