Brick Library  0.1
Performance-portable stencil datalayout & codegen
Macros | Typedefs
vecscatter.h File Reference

Interface to code generator. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define bElem   double
 Basic datatype for all brick elements. More...
 
#define VS_STRING(x)   #x
 
#define VS_TOSTR(x)   VS_STRING(x)
 
#define _SELECTMACRO(_v0, _v1, _v2, _v3, _v4, _v6, NAME, ...)   NAME
 
#define tile(...)   _SELECTMACRO(__VA_ARGS__, 0, _tile5, _tile4)(__VA_ARGS__)
 Inject stencil code for tiling here. More...
 
#define _tile4(file, vec, vsdim, titer)   do { _Pragma(VS_TOSTR(vecscatter Scatter Tile(__FILE__, __LINE__, file, VS_TOSTR(bElem), vec, tile_iter=titer, dim=vsdim))) } while (false)
 4 argument variation of tile(...) More...
 
#define _tile5(file, vec, vsdim, titer, stri)   do { _Pragma(VS_TOSTR(vecscatter Scatter Tile(__FILE__, __LINE__, file, VS_TOSTR(bElem), vec, tile_iter=titer, dim=vsdim, stride=stri))) } while (false)
 5 argument variation of tile(...) More...
 
#define brick(...)   _SELECTMACRO(__VA_ARGS__, _brick6, _brick5)(__VA_ARGS__)
 Inject stencil code for brick datalayout. More...
 
#define _brick5(file, vec, vsdim, vsfold, brickIdx)   do { _Pragma(VS_TOSTR(vecscatter Scatter Brick(__FILE__, __LINE__, file, VS_TOSTR(bElem), vec, bidx=VS_TOSTR(brickIdx), dim=vsdim, fold=vsfold))) } while (false)
 5 arguments version of brick(...) More...
 
#define _brick6(file, vec, vsdim, vsfold, brickIdx, stri)   do { _Pragma(VS_TOSTR(vecscatter Scatter Brick(__FILE__, __LINE__, file, VS_TOSTR(bElem), vec, bidx=VS_TOSTR(brickIdx), dim=vsdim, fold=vsfold, stride=stri))) } while (false)
 5 arguments version of brick(...) More...
 

Typedefs

typedef bElem vfloat512[512] __attribute__((aligned(64)))
 

Detailed Description

Interface to code generator.

Macro Definition Documentation

◆ _brick5

#define _brick5 (   file,
  vec,
  vsdim,
  vsfold,
  brickIdx 
)    do { _Pragma(VS_TOSTR(vecscatter Scatter Brick(__FILE__, __LINE__, file, VS_TOSTR(bElem), vec, bidx=VS_TOSTR(brickIdx), dim=vsdim, fold=vsfold))) } while (false)

5 arguments version of brick(...)

Parameters
filePath to the python stencil expression file as a string.
vecVectorization ISA, available choices see Vectorization in Bricks
vsdimBrick dimensions
vsfold(folded-)Vector dimensions
brickIdxIndex of the brick to compute

If file is given as a relative path, it is specified as relative to the current file.

Use from brick(...), for example:

tile("7pt.py", "AVX2", (8, 8, 8), (2, 2), b);

◆ _brick6

#define _brick6 (   file,
  vec,
  vsdim,
  vsfold,
  brickIdx,
  stri 
)    do { _Pragma(VS_TOSTR(vecscatter Scatter Brick(__FILE__, __LINE__, file, VS_TOSTR(bElem), vec, bidx=VS_TOSTR(brickIdx), dim=vsdim, fold=vsfold, stride=stri))) } while (false)

5 arguments version of brick(...)

Parameters
striStride of shift during greedy algorithm

For other parameters see _brick5(file, vec, vsdim, vsfold, brickIdx)

Use from brick(...), for example:

tile("7pt.py", "AVX2", (8, 8, 8), (2, 2), b, (1, 1, 2));

◆ _SELECTMACRO

#define _SELECTMACRO (   _v0,
  _v1,
  _v2,
  _v3,
  _v4,
  _v6,
  NAME,
  ... 
)    NAME

◆ _tile4

#define _tile4 (   file,
  vec,
  vsdim,
  titer 
)    do { _Pragma(VS_TOSTR(vecscatter Scatter Tile(__FILE__, __LINE__, file, VS_TOSTR(bElem), vec, tile_iter=titer, dim=vsdim))) } while (false)

4 argument variation of tile(...)

Parameters
filePath to the python stencil expression file as a string.
vecVectorization ISA, available choices see Vectorization in Bricks
vsdimTile dimensions
titerTiling iteration index

If file is given as a relative path, it is specified as relative to the current file.

Use from tile(...), for example:

tile("7pt.py", "AVX2", (8, 8, 8), ("tk", "tj", "ti"));

◆ _tile5

#define _tile5 (   file,
  vec,
  vsdim,
  titer,
  stri 
)    do { _Pragma(VS_TOSTR(vecscatter Scatter Tile(__FILE__, __LINE__, file, VS_TOSTR(bElem), vec, tile_iter=titer, dim=vsdim, stride=stri))) } while (false)

5 argument variation of tile(...)

Parameters
striStride of shift during greedy algorithm

For other parameters see _tile4(file, vec, vsdim, titer)

Use from tile(...), for example the following will only select shift of multiples of 4 on i-dimension:

tile("7pt.py", "AVX2", (8, 8, 8), ("tk", "tj", "ti"), (1, 1, 4));

◆ bElem

#define bElem   double

Basic datatype for all brick elements.

◆ brick

#define brick (   ...)    _SELECTMACRO(__VA_ARGS__, _brick6, _brick5)(__VA_ARGS__)

Inject stencil code for brick datalayout.

Versions of this call with different number of variables are defined in _brick5(file, vec, vsdim, vsfold, brickIdx) and _brick6(file, vec, vsdim, vsfold, brickIdx, stri)

◆ tile

#define tile (   ...)    _SELECTMACRO(__VA_ARGS__, 0, _tile5, _tile4)(__VA_ARGS__)

Inject stencil code for tiling here.

Versions of this call with different number of variables are defined in _tile4(file, vec, vsdim, titer) and _tile5(file, vec, vsdim, titer, stri).

◆ VS_STRING

#define VS_STRING (   x)    #x

◆ VS_TOSTR

#define VS_TOSTR (   x)    VS_STRING(x)
tile
#define tile(...)
Inject stencil code for tiling here.
Definition: vecscatter.h:25