Brick Library 0.1
Performance-portable stencil datalayout & codegen
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Brick< Dim< BDims... >, Dim< Folds... > > Struct Template Reference

Brick data structure. More...

#include <brick.h>

Collaboration diagram for Brick< Dim< BDims... >, Dim< Folds... > >:
[legend]

Public Types

typedef Brick< Dim< BDims... >, Dim< Folds... > > mytype
 Shorthand for this struct's type.
 
typedef BrickInfo< sizeof...(BDims)> myBrickInfo
 Shorthand for type of the metadata.
 
typedef BrickInfo< sizeof...(BDims)> myBrickInfo
 

Public Member Functions

FORCUDA _BrickAccessor< mytype, Dim< BDims... >, Dim< Folds... >, typename std::conditional< sizeof...(BDims)==sizeof...(Folds), bool, void >::type > operator[] (unsigned b)
 Indexing operator returns: Accessing brick elements using [].
 
template<unsigned ... Offsets>
FORCUDA bElemneighbor (unsigned b)
 Return the adjacency list of brick b
 
 Brick (myBrickInfo *bInfo, const BrickStorage &brickStorage, unsigned offset)
 Initialize a brick data structure.
 

Public Attributes

myBrickInfobInfo
 Pointer to (possibly shared) metadata.
 
size_t step
 Spacing between bricks in unit of bElem (BrickStorage)
 
bElemdat
 Offsetted memory (BrickStorage)
 
BrickStorage bStorage
 
unsigned step
 

Static Public Attributes

static constexpr unsigned VECLEN = cal_size<Folds...>::value
 Vector length shorthand.
 
static constexpr unsigned BRICKSIZE = cal_size<BDims...>::value
 Brick size shorthand.
 

Detailed Description

template<unsigned ... BDims, unsigned ... Folds>
struct Brick< Dim< BDims... >, Dim< Folds... > >

Brick data structure.

Template Parameters
BDimsThe brick dimensions
FoldsThe fold dimensions

Some example usage:

Brick<Dim<8,8,8>, Dim<2,4>> bIn(&bInfo, bStorage, 0); // 8x8x8 bricks with 2x4 folding
bIn[1][0][0][0] = 2; // Setting the first element for the brick at index 1 to 2
#define bIn(i, j, k)
BrickStorage bStorage
Definition: brick.h:366
myBrickInfo * bInfo
Pointer to (possibly shared) metadata.
Definition: brick.h:363
Generic base template, see Brick< Dim< BDims... >, Dim< Folds... > >
Definition: brick.h:340
Empty template to specify an n-D list.
Definition: brick.h:131

Member Typedef Documentation

◆ myBrickInfo [1/2]

template<unsigned ... BDims, unsigned ... Folds>
typedef BrickInfo<sizeof...(BDims)> Brick< Dim< BDims... >, Dim< Folds... > >::myBrickInfo

Shorthand for type of the metadata.

◆ myBrickInfo [2/2]

template<unsigned ... BDims, unsigned ... Folds>
typedef BrickInfo<sizeof...(BDims)> Brick< Dim< BDims... >, Dim< Folds... > >::myBrickInfo

◆ mytype

template<unsigned ... BDims, unsigned ... Folds>
typedef Brick<Dim<BDims...>, Dim<Folds...> > Brick< Dim< BDims... >, Dim< Folds... > >::mytype

Shorthand for this struct's type.

Constructor & Destructor Documentation

◆ Brick()

template<unsigned ... BDims, unsigned ... Folds>
Brick< Dim< BDims... >, Dim< Folds... > >::Brick ( myBrickInfo bInfo,
const BrickStorage brickStorage,
unsigned  offset 
)
inline

Initialize a brick data structure.

Parameters
bInfoPointer to metadata
bStorageBrick storage (memory region)
offsetOffset within the brick storage in number of elements, eg. is a multiple of 512 for 8x8x8 bricks

Member Function Documentation

◆ neighbor()

template<unsigned ... BDims, unsigned ... Folds>
template<unsigned ... Offsets>
FORCUDA bElem * Brick< Dim< BDims... >, Dim< Folds... > >::neighbor ( unsigned  b)
inline

Return the adjacency list of brick b

◆ operator[]()

template<unsigned ... BDims, unsigned ... Folds>
FORCUDA _BrickAccessor< mytype, Dim< BDims... >, Dim< Folds... >, typename std::conditional< sizeof...(BDims)==sizeof...(Folds), bool, void >::type > Brick< Dim< BDims... >, Dim< Folds... > >::operator[] ( unsigned  b)
inline

Indexing operator returns: Accessing brick elements using [].

Member Data Documentation

◆ bInfo

template<unsigned ... BDims, unsigned ... Folds>
myBrickInfo * Brick< Dim< BDims... >, Dim< Folds... > >::bInfo

Pointer to (possibly shared) metadata.

◆ BRICKSIZE

template<unsigned ... BDims, unsigned ... Folds>
constexpr unsigned Brick< Dim< BDims... >, Dim< Folds... > >::BRICKSIZE = cal_size<BDims...>::value
staticconstexpr

Brick size shorthand.

◆ bStorage

template<unsigned ... BDims, unsigned ... Folds>
BrickStorage Brick< Dim< BDims... >, Dim< Folds... > >::bStorage

◆ dat

template<unsigned ... BDims, unsigned ... Folds>
bElem * Brick< Dim< BDims... >, Dim< Folds... > >::dat

Offsetted memory (BrickStorage)

◆ step [1/2]

template<unsigned ... BDims, unsigned ... Folds>
size_t Brick< Dim< BDims... >, Dim< Folds... > >::step

Spacing between bricks in unit of bElem (BrickStorage)

◆ step [2/2]

template<unsigned ... BDims, unsigned ... Folds>
unsigned Brick< Dim< BDims... >, Dim< Folds... > >::step

◆ VECLEN

template<unsigned ... BDims, unsigned ... Folds>
constexpr unsigned Brick< Dim< BDims... >, Dim< Folds... > >::VECLEN = cal_size<Folds...>::value
staticconstexpr

Vector length shorthand.


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