Fermat
Public Types | Public Methods | Public Members | List of all members
cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT > Struct Template Reference

Detailed description

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
struct cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >

Wrapper class to create a block-strided iterator out of another base iterator, i.e:

it[ j ] = base[ (j / BLOCKSIZE) * stride + (j %% BLOCKSIZE) ]

or:

it[ j ] = base[ (j %% BLOCKSIZE) * stride + (j / BLOCKSIZE) ]

depending on whether the alignment is ROW_MAJOR or COLUMN_MAJOR

#include <strided_iterator.h>

Public Types

typedef std::iterator_traits< T >::value_type value_type
 
typedef std::iterator_traits< T >::reference reference
 
typedef to_const< reference >::type const_reference
 
typedef std::iterator_traits< T >::pointer pointer
 
typedef std::iterator_traits< T >::difference_type difference_type
 
typedef std::iterator_traits< T >::iterator_category iterator_category
 

Public Methods

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE block_strided_iterator ()
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE block_strided_iterator (T vec, const uint32 stride, const uint32 offset=0)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE const_reference operator* () const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE const_reference operator[] (const uint32 i) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE reference operator[] (const uint32 i)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE block_strided_iterator< BLOCKSIZE, T > operator+ (const uint32 i) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE difference_type operator- (const block_strided_iterator< BLOCKSIZE, T > it) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE block_strided_iterator< BLOCKSIZE, T > & operator++ ()
 

Public Members

m_vec
 
uint32 m_offset
 
uint32 m_stride
 

Constructor & Destructor Documentation

◆ block_strided_iterator() [1/2]

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >::block_strided_iterator ( )
inline

constructor

◆ block_strided_iterator() [2/2]

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >::block_strided_iterator ( vec,
const uint32  stride,
const uint32  offset = 0 
)
inline

constructor

Member Function Documentation

◆ operator*()

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE const_reference cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >::operator* ( ) const
inline

const dereferencing operator

◆ operator+()

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE block_strided_iterator<BLOCKSIZE,T> cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >::operator+ ( const uint32  i) const
inline

addition

◆ operator++()

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE block_strided_iterator<BLOCKSIZE,T>& cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >::operator++ ( )
inline

pre-increment

◆ operator-()

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE difference_type cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >::operator- ( const block_strided_iterator< BLOCKSIZE, T >  it) const
inline

iterator subtraction

◆ operator[]() [1/2]

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE const_reference cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >::operator[] ( const uint32  i) const
inline

const indexing operator

◆ operator[]() [2/2]

template<uint32 BLOCKSIZE, typename T, block_strided_layout LAYOUT = ROW_MAJOR_LAYOUT>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE reference cugar::block_strided_iterator< BLOCKSIZE, T, LAYOUT >::operator[] ( const uint32  i)
inline

indexing operator


The documentation for this struct was generated from the following file: