| 33 | /// Space complexity: \Omega(1) |
| 34 | template<class BufferIterator, class T> |
| 35 | inline void iota(BufferIterator first, |
| 36 | BufferIterator last, |
| 37 | const T &value, |
| 38 | command_queue &queue = system::default_queue()) |
| 39 | { |
| 40 | BOOST_STATIC_ASSERT(is_device_iterator<BufferIterator>::value); |
| 41 | T count = static_cast<T>(detail::iterator_range_size(first, last)); |
| 42 | |
| 43 | copy( |
| 44 | ::boost::compute::make_counting_iterator(value), |
| 45 | ::boost::compute::make_counting_iterator(value + count), |
| 46 | first, |
| 47 | queue |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | } // end compute namespace |
| 52 | } // end boost namespace |