parallel_utils::ParallelArray< Type, RType, PType > Class Template Reference

Encapsulates allocation/deallocation and access to arrays on both the host and device. More...

#include <parallel_array.h>

List of all members.

Public Member Functions

RType getBuffer (ArraySize offset)
RType getBuffer ()
ArraySize getByteSize (ArraySize arraySize) const
ArraySize getByteSize () const
MemFlags getFlags () const
ArraySize getInternalByteSize () const
ArraySize getInternalSize () const
ArraySize getSize () const
ArrayType getType () const
bool isDeviceArray () const
bool isHostArray () const
 ParallelArray (ArrayType type=ArrayTypes::DEVICE_ARRAY, ArraySize size=0, MemFlags flags=0)
 Constructs on instance of a parallely array according the arguments.
void print (const char *s, int stride=1) const
void printVal (const double4 &a) const
void printVal (const double3 &a) const
void printVal (const double &a) const
void printVal (const float4 &a) const
void printVal (const float3 &a) const
void printVal (const float &a) const
void printVal (const int4 &a) const
void printVal (const int &a) const
void setFlags (MemFlags flags)
void setSize (ArraySize size)
virtual ~ParallelArray ()

Protected Member Functions

virtual void dealloc ()
virtual void realloc ()

Private Types

typedef PMemManager::mem_flags MemFlags
typedef MemManager< Type, PType > PMemManager

Private Attributes

RType buffer_
MemFlags flags_
ArraySize internalSize_
ArraySize size_
ArrayType type_

Detailed Description

template<typename Type, typename RType, ParallelType PType>
class parallel_utils::ParallelArray< Type, RType, PType >

Encapsulates allocation/deallocation and access to arrays on both the host and device.

Definition at line 27 of file parallel_array.h.


Member Typedef Documentation

template<typename Type, typename RType, ParallelType PType>
typedef PMemManager::mem_flags parallel_utils::ParallelArray< Type, RType, PType >::MemFlags [private]

Definition at line 30 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
typedef MemManager<Type,PType> parallel_utils::ParallelArray< Type, RType, PType >::PMemManager [private]

Definition at line 29 of file parallel_array.h.


Constructor & Destructor Documentation

template<typename Type, typename RType, ParallelType PType>
parallel_utils::ParallelArray< Type, RType, PType >::ParallelArray ( ArrayType  type = ArrayTypes::DEVICE_ARRAY,
ArraySize  size = 0,
MemFlags  flags = 0 
) [inline]

Constructs on instance of a parallely array according the arguments.

Parameters:
type The type of array, either host or device
size The size (in elements, not bytes) of the the array
flags The flags to be used by the memory manager

Definition at line 41 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
virtual parallel_utils::ParallelArray< Type, RType, PType >::~ParallelArray (  )  [inline, virtual]

Destroys the array, freeing memory appropriately

Definition at line 49 of file parallel_array.h.


Member Function Documentation

template<typename Type, typename RType, ParallelType PType>
virtual void parallel_utils::ParallelArray< Type, RType, PType >::dealloc (  )  [inline, protected, virtual]

Definition at line 130 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
RType parallel_utils::ParallelArray< Type, RType, PType >::getBuffer ( ArraySize  offset  )  [inline]

Definition at line 115 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
RType parallel_utils::ParallelArray< Type, RType, PType >::getBuffer (  )  [inline]

Definition at line 114 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArraySize parallel_utils::ParallelArray< Type, RType, PType >::getByteSize ( ArraySize  arraySize  )  const [inline]

Definition at line 109 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArraySize parallel_utils::ParallelArray< Type, RType, PType >::getByteSize (  )  const [inline]

Definition at line 108 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
MemFlags parallel_utils::ParallelArray< Type, RType, PType >::getFlags (  )  const [inline]

Definition at line 113 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArraySize parallel_utils::ParallelArray< Type, RType, PType >::getInternalByteSize (  )  const [inline]

Definition at line 112 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArraySize parallel_utils::ParallelArray< Type, RType, PType >::getInternalSize (  )  const [inline]

Definition at line 111 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArraySize parallel_utils::ParallelArray< Type, RType, PType >::getSize (  )  const [inline]

Definition at line 110 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArrayType parallel_utils::ParallelArray< Type, RType, PType >::getType (  )  const [inline]

Definition at line 107 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
bool parallel_utils::ParallelArray< Type, RType, PType >::isDeviceArray (  )  const [inline]

Definition at line 106 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
bool parallel_utils::ParallelArray< Type, RType, PType >::isHostArray (  )  const [inline]

Definition at line 105 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::print ( const char *  s,
int  stride = 1 
) const [inline]

Prints the array to the console. Utility only.

Parameters:
s The string prefix
stride The stride between elements in the buffer to print

Definition at line 88 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::printVal ( const double4 a  )  const [inline]

Definition at line 103 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::printVal ( const double3 a  )  const [inline]

Definition at line 102 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::printVal ( const double &  a  )  const [inline]

Definition at line 101 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::printVal ( const float4 a  )  const [inline]

Definition at line 100 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::printVal ( const float3 a  )  const [inline]

Definition at line 99 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::printVal ( const float &  a  )  const [inline]

Definition at line 98 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::printVal ( const int4 a  )  const [inline]

Definition at line 97 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::printVal ( const int &  a  )  const [inline]

Definition at line 96 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
virtual void parallel_utils::ParallelArray< Type, RType, PType >::realloc (  )  [inline, protected, virtual]

Definition at line 119 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::setFlags ( MemFlags  flags  )  [inline]

Sets flags governing memory allocation and memory transfer specific for the parallel type

Parameters:
flags The flags to be used by the memory manager

Definition at line 73 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
void parallel_utils::ParallelArray< Type, RType, PType >::setSize ( ArraySize  size  )  [inline]

Sets the size of the array, reallocating memory appropriately. No guarantees on data preservation

Parameters:
size The number of elements fot the new array

Definition at line 59 of file parallel_array.h.


Member Data Documentation

template<typename Type, typename RType, ParallelType PType>
RType parallel_utils::ParallelArray< Type, RType, PType >::buffer_ [private]

Handle to the actual memory

Definition at line 145 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
MemFlags parallel_utils::ParallelArray< Type, RType, PType >::flags_ [private]

Flags governing array processing by the memory manager

Definition at line 143 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArraySize parallel_utils::ParallelArray< Type, RType, PType >::internalSize_ [private]

The internal size of the array, may be more than the reported size

Definition at line 142 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArraySize parallel_utils::ParallelArray< Type, RType, PType >::size_ [private]

The number of elements in the array

Definition at line 141 of file parallel_array.h.

template<typename Type, typename RType, ParallelType PType>
ArrayType parallel_utils::ParallelArray< Type, RType, PType >::type_ [private]

The type of the array, eithe host or device

Definition at line 140 of file parallel_array.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


parallel_quickstep
Author(s): Jared Duke
autogenerated on Fri Jan 11 09:59:43 2013