30 #ifndef HIPCUB_ROCPRIM_ITERATOR_DISCARD_OUTPUT_ITERATOR_HPP_
31 #define HIPCUB_ROCPRIM_ITERATOR_DISCARD_OUTPUT_ITERATOR_HPP_
36 #include "../../../config.hpp"
38 BEGIN_HIPCUB_NAMESPACE
39 #if (THRUST_VERSION >= 100700)
41 #include <thrust/iterator/iterator_facade.h>
42 #include <thrust/iterator/iterator_traits.h>
54 template <
typename OffsetT = ptrdiff_t>
66 #if (THRUST_VERSION >= 100700)
68 typedef typename thrust::detail::iterator_facade_category<
69 thrust::any_system_tag,
70 thrust::random_access_traversal_tag,
95 __host__ __device__ __forceinline__ self_type operator++(
int)
97 self_type retval = *
this;
106 __host__ __device__ __forceinline__ self_type operator++()
116 __host__ __device__ __forceinline__ self_type& operator*()
126 template <
typename Distance>
127 __host__ __device__ __forceinline__ self_type operator+(Distance n)
const
129 self_type retval(offset + n);
137 template <
typename Distance>
138 __host__ __device__ __forceinline__ self_type& operator+=(Distance n)
148 template <
typename Distance>
149 __host__ __device__ __forceinline__ self_type operator-(Distance n)
const
151 self_type retval(offset - n);
159 template <
typename Distance>
160 __host__ __device__ __forceinline__ self_type& operator-=(Distance n)
170 __host__ __device__ __forceinline__ difference_type operator-(self_type other)
const
172 return offset - other.offset;
179 template <
typename Distance>
180 __host__ __device__ __forceinline__ self_type& operator[](Distance)
194 __host__ __device__ __forceinline__
void operator=(T
const&)
198 __host__ __device__ __forceinline__
operator void*()
const {
return NULL; }
204 __host__ __device__ __forceinline__
bool operator==(
const self_type& rhs)
206 return (offset == rhs.offset);
213 __host__ __device__ __forceinline__
bool operator!=(
const self_type& rhs)
215 return (offset != rhs.offset);
222 friend std::ostream& operator<<(std::ostream& os,
const self_type& itr)
224 os <<
"[" << itr.offset <<
"]";
A discard iterator.
Definition: discard_output_iterator.hpp:56
void reference
The type of a reference to an element the iterator can point to.
Definition: discard_output_iterator.hpp:64
__host__ __device__ __forceinline__ pointer operator->()
Structure dereference.
Definition: discard_output_iterator.hpp:187
void value_type
The type of the element the iterator can point to.
Definition: discard_output_iterator.hpp:62
std::random_access_iterator_tag iterator_category
The iterator category.
Definition: discard_output_iterator.hpp:75
void pointer
The type of a pointer to an element the iterator can point to.
Definition: discard_output_iterator.hpp:63
DiscardOutputIterator self_type
My own type.
Definition: discard_output_iterator.hpp:60
__host__ __device__ __forceinline__ void operator=(T const &)
Assignment to anything else (no-op)
Definition: discard_output_iterator.hpp:194
OffsetT difference_type
Type to express the result of subtracting one iterator from another.
Definition: discard_output_iterator.hpp:61
__host__ __device__ __forceinline__ DiscardOutputIterator(OffsetT offset=0)
Constructor.
Definition: discard_output_iterator.hpp:85