OpenMPCD
|
Wraps an iterator range such that the iteration stride is not (necessarily) 1
.
More...
#include <StridedIteratorRange.hpp>
Classes | |
class | StrideFunctor |
Functor class for advancing a pointer by the given stride. More... | |
Public Types | |
typedef thrust::iterator_difference< UnderlyingIterator >::type | IteratorDifference |
The type of the difference of two of the underlying iterators. More... | |
typedef thrust::counting_iterator< IteratorDifference > | CountingIterator |
Type that is used to linearly increment a count. More... | |
typedef thrust::transform_iterator< StrideFunctor, CountingIterator > | TransformIterator |
Type that applies StrideFunctor to the input sequence. More... | |
typedef thrust::permutation_iterator< UnderlyingIterator, TransformIterator > | PermutationIterator |
Type that will be indexing into the UnderlyingIterator according to the TransformIterator . More... | |
typedef PermutationIterator | Iterator |
The effective iterator type. More... | |
Public Member Functions | |
StridedIteratorRange (const UnderlyingIterator &start, const UnderlyingIterator &pastTheEnd_) | |
The constructor. More... | |
Iterator | begin () const |
Returns the first iterator in the strided range. More... | |
Iterator | end () const |
Returns the first past-the-end iterator of the strided range. More... | |
Wraps an iterator range such that the iteration stride is not (necessarily) 1
.
This strided iterator range exposes the underlying iterator range in such a way that incrementing the exposed iterator (called "effective iterator") once is equivalent to incrementing the underlying iterator as many times as the stride
specifies.
examples/strided_range.cu
of the thrust
library.UnderlyingIterator | The underlying iterator type. |
stride | The iterator stride. This parameter specifies how often the underlying iterator gets incremented each time this instance of StridedIteratorRange gets incremented. The special value 0 selects a (partially) specialized template of StridedIteratorRange that allows one to set the stride in the constructor. |
Definition at line 46 of file StridedIteratorRange.hpp.
typedef thrust::counting_iterator<IteratorDifference> OpenMPCD::CUDA::StridedIteratorRange< UnderlyingIterator, stride >::CountingIterator |
Type that is used to linearly increment a count.
Definition at line 82 of file StridedIteratorRange.hpp.
typedef PermutationIterator OpenMPCD::CUDA::StridedIteratorRange< UnderlyingIterator, stride >::Iterator |
The effective iterator type.
Definition at line 95 of file StridedIteratorRange.hpp.
typedef thrust::iterator_difference<UnderlyingIterator>::type OpenMPCD::CUDA::StridedIteratorRange< UnderlyingIterator, stride >::IteratorDifference |
The type of the difference of two of the underlying iterators.
Definition at line 54 of file StridedIteratorRange.hpp.
typedef thrust::permutation_iterator< UnderlyingIterator, TransformIterator> OpenMPCD::CUDA::StridedIteratorRange< UnderlyingIterator, stride >::PermutationIterator |
Type that will be indexing into the UnderlyingIterator
according to the TransformIterator
.
Definition at line 91 of file StridedIteratorRange.hpp.
typedef thrust::transform_iterator<StrideFunctor, CountingIterator> OpenMPCD::CUDA::StridedIteratorRange< UnderlyingIterator, stride >::TransformIterator |
Type that applies StrideFunctor
to the input sequence.
Definition at line 86 of file StridedIteratorRange.hpp.
|
inline |
The constructor.
[in] | start | The first iterator to iterate over. |
[in] | pastTheEnd_ | The first iterator that is past-the-end. |
Definition at line 104 of file StridedIteratorRange.hpp.
|
inline |
Returns the first iterator in the strided range.
Definition at line 114 of file StridedIteratorRange.hpp.
|
inline |
Returns the first past-the-end iterator of the strided range.
Definition at line 123 of file StridedIteratorRange.hpp.