A random-access input generator for dereferencing a sequence of incrementing integer values.
More...
|
|
typedef CountingInputIterator | self_type |
| | My own type.
|
| |
|
typedef OffsetT | difference_type |
| | Type to express the result of subtracting one iterator from another.
|
| |
|
typedef ValueType | value_type |
| | The type of the element the iterator can point to.
|
| |
|
typedef ValueType * | pointer |
| | The type of a pointer to an element the iterator can point to.
|
| |
|
typedef ValueType | reference |
| | The type of a reference to an element the iterator can point to.
|
| |
|
typedef std::random_access_iterator_tag | iterator_category |
| | The iterator category.
|
| |
template<typename ValueType, typename OffsetT = ptrdiff_t>
class cub::CountingInputIterator< ValueType, OffsetT >
A random-access input generator for dereferencing a sequence of incrementing integer values.
- Overview
- After initializing a CountingInputIteratorTto a certain integer
base, read references at offset will return the value base + offset.
- Can be constructed, manipulated, dereferenced, and exchanged within and between host and device functions.
- Compatible with Thrust API v1.7 or newer.
- Snippet
- The code snippet below illustrates the use of
CountingInputIteratorTto dereference a sequence of incrementing integers.
#include <cub/cub.cuh>
printf("%d\n", itr[0]);
printf("%d\n", itr[1]);
printf("%d\n", itr[2]);
printf("%d\n", itr[50]);
- Template Parameters
-
| ValueType | The value type of this iterator |
| OffsetT | The difference type of this iterator (Default: ptrdiff_t) |
Definition at line 94 of file counting_input_iterator.cuh.
◆ CountingInputIterator()
template<typename ValueType , typename OffsetT = ptrdiff_t>
The documentation for this class was generated from the following file: