Brick Library 0.1
Performance-portable stencil datalayout & codegen
Loading...
Searching...
No Matches
Classes | Functions
bricksetup.h File Reference

Brick iterator and setup code. More...

#include <vector>
#include <typeinfo>
#include <initializer_list>
#include <algorithm>
#include "brick.h"
Include dependency graph for bricksetup.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  RunningTag
 
struct  StopTag
 
struct  TagSelect< select >
 
struct  TagSelect< 0 >
 

Functions

template<unsigned dims, unsigned d>
void init_fill (const std::vector< long > &stride, unsigned *adjlist, unsigned *grid_ptr, unsigned *low, unsigned *high, RunningTag t)
 
template<unsigned dims, unsigned d>
void init_fill (const std::vector< long > &stride, unsigned *adjlist, unsigned *grid_ptr, unsigned *low, unsigned *high, StopTag t)
 
template<unsigned dims, unsigned d>
void init_iter (const std::vector< long > &dimlist, const std::vector< long > &stride, BrickInfo< dims > &bInfo, unsigned *grid_ptr, unsigned *low, unsigned *high, RunningTag t)
 
template<unsigned dims, unsigned d>
void init_iter (const std::vector< long > &dimlist, const std::vector< long > &stride, BrickInfo< dims > &bInfo, unsigned *grid_ptr, unsigned *low, unsigned *high, StopTag t)
 
template<unsigned dims>
BrickInfo< dims > init_grid (unsigned *&grid_ptr, const std::vector< long > &dimlist)
 
template<unsigned dims, unsigned d, typename F , typename A >
void fill (const std::vector< long > &tile, const std::vector< long > &stride, bElem *arr, A a, F f, RunningTag t)
 
template<unsigned dims, unsigned d, typename F , typename A >
void fill (const std::vector< long > &tile, const std::vector< long > &stride, bElem *arr, A &a, F f, StopTag t)
 
template<unsigned dims, unsigned d, typename T , typename F >
void iter (const std::vector< long > &dimlist, const std::vector< long > &tile, const std::vector< long > &strideA, const std::vector< long > &strideB, const std::vector< long > &padding, const std::vector< long > &ghost, T &brick, bElem *arr, unsigned *grid_ptr, F f, RunningTag t)
 
template<unsigned dims, unsigned d, typename T , typename F >
void iter (const std::vector< long > &dimlist, const std::vector< long > &tile, const std::vector< long > &strideA, const std::vector< long > &strideB, const std::vector< long > &padding, const std::vector< long > &ghost, T &brick, bElem *arr, unsigned *grid_ptr, F f, StopTag t)
 
template<unsigned dims, typename F , typename T , unsigned ... BDims>
void iter_grid (const std::vector< long > &dimlist, const std::vector< long > &padding, const std::vector< long > &ghost, bElem *arr, unsigned *grid_ptr, Brick< Dim< BDims... >, T > &brick, F f)
 
template<unsigned dims, typename T >
void copyToBrick (const std::vector< long > &dimlist, const std::vector< long > &padding, const std::vector< long > &ghost, bElem *arr, unsigned *grid_ptr, T &brick)
 Copy values from an array to bricks.
 
template<unsigned dims, typename T >
void copyToBrick (const std::vector< long > &dimlist, bElem *arr, unsigned *grid_ptr, T &brick)
 Copy values from an array to bricks without ghost or padding.
 
template<unsigned dims, typename T >
void copyFromBrick (const std::vector< long > &dimlist, const std::vector< long > &padding, const std::vector< long > &ghost, bElem *arr, unsigned *grid_ptr, T &brick)
 Copy values from bricks to an array.
 

Detailed Description

Brick iterator and setup code.

Function Documentation

◆ copyFromBrick()

template<unsigned dims, typename T >
void copyFromBrick ( const std::vector< long > &  dimlist,
const std::vector< long > &  padding,
const std::vector< long > &  ghost,
bElem arr,
unsigned *  grid_ptr,
T &  brick 
)
inline

Copy values from bricks to an array.

Template Parameters
dimsnumber of dimensions
Ttype for brick
Parameters
dimlistdimensions, contiguous first
paddingpadding applied to array format (skipped)
ghostpadding applied to array and brick (skipped)
arrarray input
grid_ptrthe grid array contains indices of bricks
brickthe brick data structure

◆ copyToBrick() [1/2]

template<unsigned dims, typename T >
void copyToBrick ( const std::vector< long > &  dimlist,
bElem arr,
unsigned *  grid_ptr,
T &  brick 
)
inline

Copy values from an array to bricks without ghost or padding.

Template Parameters
dims
T
Parameters
dimlist
arr
grid_ptr
brick

For parameters see copyToBrick(const std::vector<long> &dimlist, const std::vector<long> &padding, const std::vector<long> &ghost, bElem *arr, unsigned *grid_ptr, T &brick)

◆ copyToBrick() [2/2]

template<unsigned dims, typename T >
void copyToBrick ( const std::vector< long > &  dimlist,
const std::vector< long > &  padding,
const std::vector< long > &  ghost,
bElem arr,
unsigned *  grid_ptr,
T &  brick 
)
inline

Copy values from an array to bricks.

Template Parameters
dimsnumber of dimensions
Ttype for brick
Parameters
dimlistdimensions, contiguous first
paddingpadding applied to array format (skipped)
ghostpadding applied to array and brick (skipped)
arrarray input
grid_ptrthe grid array contains indices of bricks
brickthe brick data structure

◆ fill() [1/2]

template<unsigned dims, unsigned d, typename F , typename A >
void fill ( const std::vector< long > &  tile,
const std::vector< long > &  stride,
bElem arr,
A &  a,
f,
StopTag  t 
)
inline

◆ fill() [2/2]

template<unsigned dims, unsigned d, typename F , typename A >
void fill ( const std::vector< long > &  tile,
const std::vector< long > &  stride,
bElem arr,
a,
f,
RunningTag  t 
)
inline

◆ init_fill() [1/2]

template<unsigned dims, unsigned d>
void init_fill ( const std::vector< long > &  stride,
unsigned *  adjlist,
unsigned *  grid_ptr,
unsigned *  low,
unsigned *  high,
RunningTag  t 
)
inline
Here is the call graph for this function:

◆ init_fill() [2/2]

template<unsigned dims, unsigned d>
void init_fill ( const std::vector< long > &  stride,
unsigned *  adjlist,
unsigned *  grid_ptr,
unsigned *  low,
unsigned *  high,
StopTag  t 
)
inline

◆ init_grid()

template<unsigned dims>
BrickInfo< dims > init_grid ( unsigned *&  grid_ptr,
const std::vector< long > &  dimlist 
)

◆ init_iter() [1/2]

template<unsigned dims, unsigned d>
void init_iter ( const std::vector< long > &  dimlist,
const std::vector< long > &  stride,
BrickInfo< dims > &  bInfo,
unsigned *  grid_ptr,
unsigned *  low,
unsigned *  high,
RunningTag  t 
)
inline

◆ init_iter() [2/2]

template<unsigned dims, unsigned d>
void init_iter ( const std::vector< long > &  dimlist,
const std::vector< long > &  stride,
BrickInfo< dims > &  bInfo,
unsigned *  grid_ptr,
unsigned *  low,
unsigned *  high,
StopTag  t 
)
inline

◆ iter() [1/2]

template<unsigned dims, unsigned d, typename T , typename F >
void iter ( const std::vector< long > &  dimlist,
const std::vector< long > &  tile,
const std::vector< long > &  strideA,
const std::vector< long > &  strideB,
const std::vector< long > &  padding,
const std::vector< long > &  ghost,
T &  brick,
bElem arr,
unsigned *  grid_ptr,
f,
RunningTag  t 
)
inline

◆ iter() [2/2]

template<unsigned dims, unsigned d, typename T , typename F >
void iter ( const std::vector< long > &  dimlist,
const std::vector< long > &  tile,
const std::vector< long > &  strideA,
const std::vector< long > &  strideB,
const std::vector< long > &  padding,
const std::vector< long > &  ghost,
T &  brick,
bElem arr,
unsigned *  grid_ptr,
f,
StopTag  t 
)
inline

◆ iter_grid()

template<unsigned dims, typename F , typename T , unsigned ... BDims>
void iter_grid ( const std::vector< long > &  dimlist,
const std::vector< long > &  padding,
const std::vector< long > &  ghost,
bElem arr,
unsigned *  grid_ptr,
Brick< Dim< BDims... >, T > &  brick,
f 
)
inline