#include <PSkelMask.h>
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 |
T | haloValue |
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.
PSkel::MaskBase< T >::MaskBase | ( | size_t | size = 0 , |
size_t | dimension = 0 , |
||
T | haloVal = T(0) , |
||
size_t | range = 0 |
||
) | [protected] |
The MaskBase constructor creates and allocates the specified mask in the host memory.
[in] | size | the size of the mask. |
[in] | dimension | the dimension of the mask. |
[in] | haloVal | the value used when the array is accessed out of bounds. |
[in] | range | the range of the mask; if range is 0, it is calculated as the maximum absolute value on the mask. |
void PSkel::MaskBase< T >::deviceAlloc | ( | ) |
Allocates the mask in device memory, including both the indexes and the weights.
void PSkel::MaskBase< T >::deviceFree | ( | ) |
Frees the allocated device memory.
T PSkel::MaskBase< T >::getWeight | ( | size_t | n | ) |
Get the weight of a given element in the mask.
[in] | n | index of the element in the mask. |
void PSkel::MaskBase< T >::hostAlloc | ( | ) |
Allocates the mask in host (main) memory, including both the indexes and the weights.
void PSkel::MaskBase< T >::hostFree | ( | ) |
Frees the allocated host (main) memory.
size_t PSkel::MaskBase< T >::memSize | ( | ) | const |
Get the size, in bytes, of the allocated memory for storing the mask.