Lift
Library of parallel computing primitives for GPUs and multi-core CPUs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | Protected Attributes | List of all members
lift::tagged_pointer_base< system, T, _index_type > Struct Template Reference

Base class for tagged memory pointer implementation. More...

#include <pointer.h>

Inheritance diagram for lift::tagged_pointer_base< system, T, _index_type >:
lift::pointer< system, T, _index_type > lift::allocation< system, T, _index_type > lift::allocation< system, T, _index_type, allocator > lift::persistent_allocation< system, T, _index_type, allocator >

Public Types

enum  { system_tag = system }
 
typedef T value_type
 
typedef const T const_value_type
 
typedef _index_type index_type
 
typedef index_type size_type
 
typedef index_type difference_type
 
typedef T & reference_type
 
typedef const T & const_reference_type
 
typedef T * pointer_type
 
typedef const T * const_pointer_type
 
typedef T * iterator_type
 
typedef const T * const_iterator_type
 
typedef
thrust_iterator_adaptor
< system, value_type,
iterator_type
thrust_iterator_type
 Thrust-compatible iterator types. More...
 
typedef
thrust_iterator_adaptor
< system, value_type,
const_iterator_type
thrust_const_iterator_type
 

Public Member Functions

LIFT_HOST_DEVICE tagged_pointer_base ()
 The default constructor initializes the pointer to null. More...
 
LIFT_HOST_DEVICE tagged_pointer_base (T *storage, size_type storage_size)
 Construct a tagged pointer from a raw pointer. More...
 
template<target_system other_system, typename other_value_type >
LIFT_HOST_DEVICE tagged_pointer_base (tagged_pointer_base< other_system, other_value_type, index_type > &other)
 Copy constructor creates a copy of the pointer. More...
 
template<typename other_pointer >
LIFT_HOST_DEVICE tagged_pointer_base (other_pointer &other)
 
template<target_system other_system, typename other_value_type >
LIFT_HOST_DEVICE
tagged_pointer_base
operator= (tagged_pointer_base< other_system, other_value_type, index_type > &other)
 Copy constructor creates a copy of the pointer. More...
 
LIFT_HOST_DEVICE
const_reference_type 
at (size_type pos) const
 
LIFT_HOST_DEVICE reference_type at (size_type pos)
 
LIFT_HOST_DEVICE
const_reference_type 
operator[] (size_type pos) const
 
LIFT_HOST_DEVICE reference_type operator[] (size_type pos)
 
LIFT_HOST_DEVICE
const_reference_type 
front () const
 
LIFT_HOST_DEVICE reference_type front ()
 
LIFT_HOST_DEVICE
const_reference_type 
back () const
 
LIFT_HOST_DEVICE reference_type back ()
 
LIFT_HOST_DEVICE
const_iterator_type 
begin () const
 
LIFT_HOST_DEVICE iterator_type begin ()
 
LIFT_HOST_DEVICE
const_iterator_type 
end () const
 
LIFT_HOST_DEVICE iterator_type end ()
 
LIFT_HOST_DEVICE
const_iterator_type 
cbegin () const
 
LIFT_HOST_DEVICE
const_iterator_type 
cend () const
 
LIFT_HOST_DEVICE
thrust_const_iterator_type 
t_begin () const
 Returns a Thrust-compatible iterator pointing at the base address of the pointer. More...
 
LIFT_HOST_DEVICE
thrust_iterator_type 
t_begin ()
 Returns a Thrust-compatible iterator pointing at the base address of the pointer. More...
 
LIFT_HOST_DEVICE
thrust_const_iterator_type 
t_end () const
 Returns a Thrust-compatible iterator pointing at the end of the memory region covered by this pointer object. More...
 
LIFT_HOST_DEVICE
thrust_iterator_type 
t_end ()
 Returns a Thrust-compatible iterator pointing at the end of the memory region covered by this pointer object. More...
 
LIFT_HOST_DEVICE size_type size () const
 
LIFT_HOST_DEVICE bool empty () const
 
LIFT_HOST_DEVICE pointer_type data () const
 

Protected Attributes

pointer_type storage
 
size_type storage_size
 

Detailed Description

template<target_system system, typename T, typename _index_type>
struct lift::tagged_pointer_base< system, T, _index_type >

Base class for tagged memory pointer implementation.

Contains most of the common functionality for pointers that is not system-specific.

Template Parameters
systemDefines the target memory space for this pointer
TThe underlying data type the pointer points at
_index_typeIntegral type used in offset calculations. Most GPU architectures lack full hardware support for 64-bit integer math, and so can benefit from having a 32-bit index even when building 64-bit code.

Definition at line 57 of file pointer.h.

Member Typedef Documentation

template<target_system system, typename T, typename _index_type>
typedef const T* lift::tagged_pointer_base< system, T, _index_type >::const_iterator_type

Definition at line 73 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef const T* lift::tagged_pointer_base< system, T, _index_type >::const_pointer_type

Definition at line 71 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef const T& lift::tagged_pointer_base< system, T, _index_type >::const_reference_type

Definition at line 69 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef const T lift::tagged_pointer_base< system, T, _index_type >::const_value_type

Definition at line 64 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef index_type lift::tagged_pointer_base< system, T, _index_type >::difference_type

Definition at line 67 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef _index_type lift::tagged_pointer_base< system, T, _index_type >::index_type

Definition at line 65 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef T* lift::tagged_pointer_base< system, T, _index_type >::iterator_type

Definition at line 72 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef T* lift::tagged_pointer_base< system, T, _index_type >::pointer_type

Definition at line 70 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef T& lift::tagged_pointer_base< system, T, _index_type >::reference_type

Definition at line 68 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef index_type lift::tagged_pointer_base< system, T, _index_type >::size_type

Definition at line 66 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef thrust_iterator_adaptor<system, value_type, const_iterator_type> lift::tagged_pointer_base< system, T, _index_type >::thrust_const_iterator_type

Definition at line 77 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef thrust_iterator_adaptor<system, value_type, iterator_type> lift::tagged_pointer_base< system, T, _index_type >::thrust_iterator_type

Thrust-compatible iterator types.

Definition at line 76 of file pointer.h.

template<target_system system, typename T, typename _index_type>
typedef T lift::tagged_pointer_base< system, T, _index_type >::value_type

Definition at line 63 of file pointer.h.

Member Enumeration Documentation

template<target_system system, typename T, typename _index_type>
anonymous enum
Enumerator
system_tag 

Definition at line 59 of file pointer.h.

Constructor & Destructor Documentation

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE lift::tagged_pointer_base< system, T, _index_type >::tagged_pointer_base ( )
inline

The default constructor initializes the pointer to null.

Definition at line 80 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE lift::tagged_pointer_base< system, T, _index_type >::tagged_pointer_base ( T *  storage,
size_type  storage_size 
)
inline

Construct a tagged pointer from a raw pointer.

Definition at line 85 of file pointer.h.

template<target_system system, typename T, typename _index_type>
template<target_system other_system, typename other_value_type >
LIFT_HOST_DEVICE lift::tagged_pointer_base< system, T, _index_type >::tagged_pointer_base ( tagged_pointer_base< other_system, other_value_type, index_type > &  other)
inline

Copy constructor creates a copy of the pointer.

If the target system mismatches, however, a null pointer is created.

Definition at line 92 of file pointer.h.

template<target_system system, typename T, typename _index_type>
template<typename other_pointer >
LIFT_HOST_DEVICE lift::tagged_pointer_base< system, T, _index_type >::tagged_pointer_base ( other_pointer &  other)
inline

Definition at line 106 of file pointer.h.

Member Function Documentation

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE const_reference_type lift::tagged_pointer_base< system, T, _index_type >::at ( size_type  pos) const
inline

Definition at line 136 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE reference_type lift::tagged_pointer_base< system, T, _index_type >::at ( size_type  pos)
inline

Definition at line 141 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE const_reference_type lift::tagged_pointer_base< system, T, _index_type >::back ( ) const
inline

Definition at line 166 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE reference_type lift::tagged_pointer_base< system, T, _index_type >::back ( )
inline

Definition at line 171 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE const_iterator_type lift::tagged_pointer_base< system, T, _index_type >::begin ( ) const
inline

Definition at line 176 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE iterator_type lift::tagged_pointer_base< system, T, _index_type >::begin ( )
inline

Definition at line 181 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE const_iterator_type lift::tagged_pointer_base< system, T, _index_type >::cbegin ( ) const
inline

Definition at line 196 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE const_iterator_type lift::tagged_pointer_base< system, T, _index_type >::cend ( ) const
inline

Definition at line 201 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE pointer_type lift::tagged_pointer_base< system, T, _index_type >::data ( void  ) const
inline

Definition at line 244 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE bool lift::tagged_pointer_base< system, T, _index_type >::empty ( ) const
inline

Definition at line 239 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE const_iterator_type lift::tagged_pointer_base< system, T, _index_type >::end ( ) const
inline

Definition at line 186 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE iterator_type lift::tagged_pointer_base< system, T, _index_type >::end ( )
inline

Definition at line 191 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE const_reference_type lift::tagged_pointer_base< system, T, _index_type >::front ( ) const
inline

Definition at line 156 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE reference_type lift::tagged_pointer_base< system, T, _index_type >::front ( )
inline

Definition at line 161 of file pointer.h.

template<target_system system, typename T, typename _index_type>
template<target_system other_system, typename other_value_type >
LIFT_HOST_DEVICE tagged_pointer_base& lift::tagged_pointer_base< system, T, _index_type >::operator= ( tagged_pointer_base< other_system, other_value_type, index_type > &  other)
inline

Copy constructor creates a copy of the pointer.

If the target system mismatches, however, a null pointer is created.

Definition at line 121 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE const_reference_type lift::tagged_pointer_base< system, T, _index_type >::operator[] ( size_type  pos) const
inline

Definition at line 146 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE reference_type lift::tagged_pointer_base< system, T, _index_type >::operator[] ( size_type  pos)
inline

Definition at line 151 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE size_type lift::tagged_pointer_base< system, T, _index_type >::size ( void  ) const
inline

Definition at line 234 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE thrust_const_iterator_type lift::tagged_pointer_base< system, T, _index_type >::t_begin ( ) const
inline

Returns a Thrust-compatible iterator pointing at the base address of the pointer.

Definition at line 207 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE thrust_iterator_type lift::tagged_pointer_base< system, T, _index_type >::t_begin ( )
inline

Returns a Thrust-compatible iterator pointing at the base address of the pointer.

Definition at line 213 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE thrust_const_iterator_type lift::tagged_pointer_base< system, T, _index_type >::t_end ( ) const
inline

Returns a Thrust-compatible iterator pointing at the end of the memory region covered by this pointer object.

Definition at line 220 of file pointer.h.

template<target_system system, typename T, typename _index_type>
LIFT_HOST_DEVICE thrust_iterator_type lift::tagged_pointer_base< system, T, _index_type >::t_end ( )
inline

Returns a Thrust-compatible iterator pointing at the end of the memory region covered by this pointer object.

Definition at line 227 of file pointer.h.

Member Data Documentation

template<target_system system, typename T, typename _index_type>
pointer_type lift::tagged_pointer_base< system, T, _index_type >::storage
protected

Definition at line 250 of file pointer.h.

template<target_system system, typename T, typename _index_type>
size_type lift::tagged_pointer_base< system, T, _index_type >::storage_size
protected

Definition at line 251 of file pointer.h.


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