PSkel
 All Classes Files Functions
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
PSkel::MaskBase< T > Class Template Reference

#include <PSkelMask.h>

Inheritance diagram for PSkel::MaskBase< T >:
PSkel::Mask< T > PSkel::Mask2D< T > PSkel::Mask3D< T >

List of all members.

Public Member Functions

void deviceAlloc ()
void copyToDevice ()
void deviceFree ()
void hostAlloc ()
void hostFree ()
size_t memSize () const
__device__ __host__ T getWeight (size_t n)

Public Attributes

size_t size
size_t dimension
size_t range

Protected Member Functions

 MaskBase (size_t size=0, size_t dimension=0, T haloVal=T(0), size_t range=0)

Protected Attributes

int * hostMask
int * deviceMask
T * hostWeight
T * deviceWeight
haloValue

Detailed Description

template<typename T>
class PSkel::MaskBase< T >

MaskBase is the basic class that implements the mask data structure used by the stencil skeleton in order to select the neighborhood for each element of a given input array.


Constructor & Destructor Documentation

template<typename T >
PSkel::MaskBase< T >::MaskBase ( size_t  size = 0,
size_t  dimension = 0,
haloVal = T(0),
size_t  range = 0 
) [protected]

The MaskBase constructor creates and allocates the specified mask in the host memory.

Parameters:
[in]sizethe size of the mask.
[in]dimensionthe dimension of the mask.
[in]haloValthe value used when the array is accessed out of bounds.
[in]rangethe range of the mask; if range is 0, it is calculated as the maximum absolute value on the mask.

Member Function Documentation

template<typename T >
void PSkel::MaskBase< T >::deviceAlloc ( )

Allocates the mask in device memory, including both the indexes and the weights.

template<typename T >
void PSkel::MaskBase< T >::deviceFree ( )

Frees the allocated device memory.

template<typename T >
T PSkel::MaskBase< T >::getWeight ( size_t  n)

Get the weight of a given element in the mask.

Parameters:
[in]nindex of the element in the mask.
Returns:
the weight of the specified element.
template<typename T >
void PSkel::MaskBase< T >::hostAlloc ( )

Allocates the mask in host (main) memory, including both the indexes and the weights.

template<typename T >
void PSkel::MaskBase< T >::hostFree ( )

Frees the allocated host (main) memory.

template<typename T >
size_t PSkel::MaskBase< T >::memSize ( ) const

Get the size, in bytes, of the allocated memory for storing the mask.

Returns:
the total of bytes allocated in memory for storing the mask.

The documentation for this class was generated from the following files:
 All Classes Files Functions