Go to the documentation of this file.
6 #ifndef OPENMPCD_STRIDEDPOINTERITERATOR_HPP
7 #define OPENMPCD_STRIDEDPOINTERITERATOR_HPP
12 #include <boost/static_assert.hpp>
25 BOOST_STATIC_ASSERT(stride != 0);
53 : current(rhs.current), pastEnd(rhs.pastEnd)
79 return current == pastEnd;
129 #ifndef __CUDA_ARCH__
144 #ifndef __CUDA_ARCH__
159 #ifndef __CUDA_ARCH__
174 #ifndef __CUDA_ARCH__
189 #ifndef __CUDA_ARCH__
194 for(
unsigned int i=0; i<stride; ++i)
212 #ifndef __CUDA_ARCH__
219 for(
unsigned int i=0; i<stride; ++i)
237 for(
unsigned int i=0; i<n; ++i)
257 #ifndef __CUDA_ARCH__
262 return current == rhs.current;
274 #ifndef __CUDA_ARCH__
279 return current != rhs.current;
284 const Pointee* pastEnd;
295 template<
typename Po
intee,
unsigned int str
ide>
296 struct iterator_traits<OpenMPCD::StridedPointerIterator<Pointee, stride> >
Exception for a forbidden function call.
#define OPENMPCD_THROW(ExceptionType, message)
Throws the given ExceptionType, passing the given message along with file and line number information...
OPENMPCD_CUDA_HOST_AND_DEVICE bool operator!=(const StridedPointerIterator &rhs) const
Returns whether the address this instance and rhs point to different memory.
OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator()
The default constructor.
OPENMPCD_CUDA_HOST_AND_DEVICE bool isSingular() const
Returns whether this instance is singular, i.e.
OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator & operator++()
The prefix increment operator.
Pointee value_type
Type iterated over.
const OPENMPCD_CUDA_HOST_AND_DEVICE Pointee * operator->() const
Member access operator.
Wraps a pointer in such a way that incrementing this iterator is equivalent to incrementing the under...
#define OPENMPCD_CUDA_HOST_AND_DEVICE
Denotes a function to be callable both from the Host and from a CUDA Device.
value_type * pointer
Pointer to the type iterated over.
OPENMPCD_CUDA_HOST_AND_DEVICE Pointee * operator->()
Member access operator.
const OPENMPCD_CUDA_HOST_AND_DEVICE Pointee & operator*() const
Dereferencing operator.
OPENMPCD_CUDA_HOST_AND_DEVICE bool isDereferenceable() const
Returns whether this instance can be dereferenced.
OPENMPCD_CUDA_HOST_AND_DEVICE bool isIncrementable() const
Returns whether this instance is incrementable.
OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator(Pointee *const start, const Pointee *const pastEnd_)
The constructor.
const OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator & operator+=(const unsigned int n)
Advances the pointer n times, or until the past-the-end iterator is reached, whichever comes first.
value_type & reference
Reference to the type iterated over.
OPENMPCD_CUDA_HOST_AND_DEVICE bool isPastTheEnd() const
Returns whether this iterator is past-the-end.
OPENMPCD_CUDA_HOST_AND_DEVICE bool operator==(const StridedPointerIterator &rhs) const
Returns whether the address this instance and rhs point to the same memory.
std::ptrdiff_t difference_type
Type for distance between iterators.
OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator(const StridedPointerIterator &rhs)
The copy constructor.
OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator operator++(int)
The postfix increment operator.
OPENMPCD_CUDA_HOST_AND_DEVICE Pointee & operator*()
Dereferencing operator.
OPENMPCD_CUDA_HOST_AND_DEVICE bool isValid() const
Returns whether this instance is valid.
std::input_iterator_tag iterator_category
Specifies the iterator category.