Public Member Functions | Private Types | Private Attributes
parallel_utils::ParallelHDArray< Type, PType > Class Template Reference

Wraps both a host and device ParallArray and exposes methods for synchronizing between the two. More...

#include <parallel_array.h>

List of all members.

Public Member Functions

ArraySize getByteSize () const
ArraySize getByteSize (ArraySize arraySize) const
DType getDeviceBuffer ()
DType getDeviceBuffer (ArraySize offset)
MemFlags getFlags () const
HType getHostBuffer ()
HType getHostBuffer (ArraySize offset)
ArraySize getSize () const
 ParallelHDArray (ArraySize size=0, MemFlags flags=0, SType stream=0)
void print (const char *s, int stride=1) const
void setFlags (MemFlags flags)
void setSize (ArraySize size)
void syncToDevice (ArraySize offset, ArraySize length, CopyType copyType=CopyTypes::COPY_DEFAULT)
void syncToDevice (CopyType copyType=CopyTypes::COPY_DEFAULT)
void syncToHost (ArraySize offset, ArraySize length, CopyType copyType=CopyTypes::COPY_DEFAULT)
void syncToHost (CopyType copyType=CopyTypes::COPY_DEFAULT)
virtual ~ParallelHDArray ()

Private Types

typedef PMemManager::device_type DType
typedef PMemManager::host_type HType
typedef PMemManager::mem_flags MemFlags
typedef MemManager< Type, PType > PMemManager
typedef PMemManager::stream_type SType

Private Attributes

ParallelArray< Type, DType, PType > deviceArray_
ParallelArray< Type, HType, PType > hostArray_
SType stream_

Detailed Description

template<class Type, ParallelType PType>
class parallel_utils::ParallelHDArray< Type, PType >

Wraps both a host and device ParallArray and exposes methods for synchronizing between the two.

Definition at line 151 of file parallel_array.h.


Member Typedef Documentation

template<class Type , ParallelType PType>
typedef PMemManager::device_type parallel_utils::ParallelHDArray< Type, PType >::DType [private]

Definition at line 154 of file parallel_array.h.

template<class Type , ParallelType PType>
typedef PMemManager::host_type parallel_utils::ParallelHDArray< Type, PType >::HType [private]

Definition at line 155 of file parallel_array.h.

template<class Type , ParallelType PType>
typedef PMemManager::mem_flags parallel_utils::ParallelHDArray< Type, PType >::MemFlags [private]

Definition at line 157 of file parallel_array.h.

template<class Type , ParallelType PType>
typedef MemManager<Type,PType> parallel_utils::ParallelHDArray< Type, PType >::PMemManager [private]

Definition at line 153 of file parallel_array.h.

template<class Type , ParallelType PType>
typedef PMemManager::stream_type parallel_utils::ParallelHDArray< Type, PType >::SType [private]

Definition at line 156 of file parallel_array.h.


Constructor & Destructor Documentation

template<class Type , ParallelType PType>
parallel_utils::ParallelHDArray< Type, PType >::ParallelHDArray ( ArraySize  size = 0,
MemFlags  flags = 0,
SType  stream = 0 
) [inline]

Constructs an instance of the class, initializing both host and device arrays

Parameters:
sizeThe number of elements
flagsFlags governing memory operations
stream

Definition at line 168 of file parallel_array.h.

template<class Type , ParallelType PType>
virtual parallel_utils::ParallelHDArray< Type, PType >::~ParallelHDArray ( ) [inline, virtual]

Destroys the object, freeing both host and device arrays

Definition at line 176 of file parallel_array.h.


Member Function Documentation

template<class Type , ParallelType PType>
ArraySize parallel_utils::ParallelHDArray< Type, PType >::getByteSize ( ) const [inline]

Definition at line 250 of file parallel_array.h.

template<class Type , ParallelType PType>
ArraySize parallel_utils::ParallelHDArray< Type, PType >::getByteSize ( ArraySize  arraySize) const [inline]

Definition at line 251 of file parallel_array.h.

template<class Type , ParallelType PType>
DType parallel_utils::ParallelHDArray< Type, PType >::getDeviceBuffer ( ) [inline]

Definition at line 255 of file parallel_array.h.

template<class Type , ParallelType PType>
DType parallel_utils::ParallelHDArray< Type, PType >::getDeviceBuffer ( ArraySize  offset) [inline]

Definition at line 257 of file parallel_array.h.

template<class Type , ParallelType PType>
MemFlags parallel_utils::ParallelHDArray< Type, PType >::getFlags ( ) const [inline]

Definition at line 253 of file parallel_array.h.

template<class Type , ParallelType PType>
HType parallel_utils::ParallelHDArray< Type, PType >::getHostBuffer ( ) [inline]

Definition at line 254 of file parallel_array.h.

template<class Type , ParallelType PType>
HType parallel_utils::ParallelHDArray< Type, PType >::getHostBuffer ( ArraySize  offset) [inline]

Definition at line 256 of file parallel_array.h.

template<class Type , ParallelType PType>
ArraySize parallel_utils::ParallelHDArray< Type, PType >::getSize ( ) const [inline]

Definition at line 252 of file parallel_array.h.

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

Prints the contents of the host array

Parameters:
sThe prefix
strideThe stride between elements

Definition at line 248 of file parallel_array.h.

template<class Type , ParallelType PType>
void parallel_utils::ParallelHDArray< Type, PType >::setFlags ( MemFlags  flags) [inline]

Sets the flags of the host and device arrays

Parameters:
flagsThe flags to set

Definition at line 236 of file parallel_array.h.

template<class Type , ParallelType PType>
void parallel_utils::ParallelHDArray< Type, PType >::setSize ( ArraySize  size) [inline]

Sets the size of the host and device arrays

Parameters:
sizeThe size of the arrays

Definition at line 225 of file parallel_array.h.

template<class Type , ParallelType PType>
void parallel_utils::ParallelHDArray< Type, PType >::syncToDevice ( ArraySize  offset,
ArraySize  length,
CopyType  copyType = CopyTypes::COPY_DEFAULT 
) [inline]

Copies data form the host to the device

Parameters:
offsetThe offset into the array from which to copy
lengthThe number of elements to copy
copyTypeThe type of copy, synchronous or asynchronous

Definition at line 200 of file parallel_array.h.

template<class Type , ParallelType PType>
void parallel_utils::ParallelHDArray< Type, PType >::syncToDevice ( CopyType  copyType = CopyTypes::COPY_DEFAULT) [inline]

Copies size number of elements from the host to the device

Parameters:
copyTypeThe type of copy, synchronous or asynchronous

Definition at line 218 of file parallel_array.h.

template<class Type , ParallelType PType>
void parallel_utils::ParallelHDArray< Type, PType >::syncToHost ( ArraySize  offset,
ArraySize  length,
CopyType  copyType = CopyTypes::COPY_DEFAULT 
) [inline]

Copies data from the device to the host

Parameters:
offsetThe offset into the array from which to copy
lengthThe number of elements to copy
copyTypeThe type of copy, synchronous or asynchronous

Definition at line 187 of file parallel_array.h.

template<class Type , ParallelType PType>
void parallel_utils::ParallelHDArray< Type, PType >::syncToHost ( CopyType  copyType = CopyTypes::COPY_DEFAULT) [inline]

Copies size number of elements from the device to the host

Parameters:
copyTypeThe type of copy, synchronous or asynchronous

Definition at line 211 of file parallel_array.h.


Member Data Documentation

template<class Type , ParallelType PType>
ParallelArray<Type,DType,PType> parallel_utils::ParallelHDArray< Type, PType >::deviceArray_ [private]

Handle to the device side ParallelArray

Definition at line 266 of file parallel_array.h.

template<class Type , ParallelType PType>
ParallelArray<Type,HType,PType> parallel_utils::ParallelHDArray< Type, PType >::hostArray_ [private]

Handle toe the host side ParallelArray

Definition at line 265 of file parallel_array.h.

template<class Type , ParallelType PType>
SType parallel_utils::ParallelHDArray< Type, PType >::stream_ [private]

The type of stream, specific to the underlying architecture

Definition at line 263 of file parallel_array.h.


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


parallel_quickstep
Author(s): Jared Duke
autogenerated on Wed Apr 23 2014 10:23:51