Brick Library 0.1
Performance-portable stencil datalayout & codegen
|
How to use the template library
Brick library enables fine-grained data blocking for use in regular C++ program. It should support initialization of bricks and copying between regular array layout.
The brick library uses C++ templates to handle dimensions and address calculation. There are three main components/data structures.
To create a brick data structure consider the code in d3pt7
from stencils/3axis.cpp
.
The above code creates $4\times 4 \times 4$ of $8\times 8\times 8$ bricks with two brick accessors interleaved. The following explains each line:
grid_ptr
. The second argument is the size of the grid in number of bricks per dimension.bStorage
. Each vector in brick is $2\times 2$.Currently, the following requires manual cleanup.
grid_ptr
created by either the user or with init_grid
methods.adj
field in brickInfo.