18 #if !defined( BOLT_AMP_COUNTING_ITERATOR_H )
19 #define BOLT_AMP_COUNTING_ITERATOR_H
73 template<
typename value_type >
74 class counting_iterator:
public std::iterator< counting_iterator_tag, typename value_type, int>
77 typedef typename std::iterator< counting_iterator_tag, typename value_type, int>::difference_type
80 typedef concurrency::array_view< value_type > arrayview_type;
86 m_initValue( init ), m_Index( 0 ) {}
89 template<
typename OtherType >
91 m_initValue( rhs.m_initValue ) {}
99 m_initValue = rhs.m_initValue;
100 m_Index = rhs.m_Index;
120 result.advance( -n );
130 value_type* getPointer()
135 const value_type* getPointer()
const
147 return m_Index - rhs.m_Index;
151 difference_type m_Index;
157 void advance( difference_type n )
191 difference_type getIndex()
const
196 template<
typename OtherType >
199 bool sameIndex = (rhs.m_initValue == m_initValue) && (rhs.m_Index == m_Index);
204 template<
typename OtherType >
207 bool sameIndex = (rhs.m_initValue != m_initValue) || (rhs.m_Index != m_Index);
212 template<
typename OtherType >
213 bool operator< ( const counting_iterator< OtherType >& rhs )
const
215 bool sameIndex = (m_Index < rhs.m_Index);
220 value_type operator*()
const restrict(cpu,amp)
222 value_type xy = m_initValue + m_Index;
227 value_type operator[](
int x)
const restrict(cpu,amp)
229 value_type temp = m_initValue + x;
234 value_type m_initValue;
238 template<
typename Type >