Brick Library  0.1
Performance-portable stencil datalayout & codegen
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. More...
 
typedef BrickInfo< sizeof...(BDims)> myBrickInfo
 Shorthand for type of the metadata. More...
 

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 []. More...
 
template<unsigned ... Offsets>
FORCUDA bElemneighbor (unsigned b)
 Return the adjacency list of brick b More...
 
FORCUDA Brick (myBrickInfo *bInfo, const BrickStorage &bStorage, unsigned offset)
 Initialize a brick data structure. More...
 

Public Attributes

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

Static Public Attributes

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

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

Member Typedef Documentation

◆ myBrickInfo

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

Shorthand for type of the metadata.

◆ 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>
FORCUDA Brick< Dim< BDims... >, Dim< Folds... > >::Brick ( myBrickInfo bInfo,
const BrickStorage bStorage,
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.

◆ dat

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

Offsetted memory (BrickStorage)

◆ step

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

Spacing between bricks in unit of bElem (BrickStorage)

◆ 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 file:
Dim
Empty template to specify an n-D list.
Definition: brick.h:125
Brick< Dim< BDims... >, Dim< Folds... > >::bInfo
myBrickInfo * bInfo
Pointer to (possibly shared) metadata.
Definition: brick.h:357
Brick
Generic base template, see Brick< Dim< BDims... >, Dim< Folds... > >
Definition: brick.h:334