![]() |
StencilStream v3.0.0
SYCL-based Stencil Simulation Framework Targeting FPGAs
|
The stencil buffer. More...
#include <Stencil.hpp>
Public Types | |
using | index_stencil_t = ac_int< bits_stencil, true > |
A signed index type for column and row indices in this stencil. | |
using | uindex_stencil_t = ac_int< bits_stencil, false > |
An unsigned index type for column and row indices in this stencil. | |
using | StencilID = GenericID< index_stencil_t > |
A signed, two-dimensional index to address cells in this stencil. | |
using | StencilUID = GenericID< uindex_stencil_t > |
An unsigned, two-dimensional index to address cells in this stencil. | |
Public Member Functions | |
Stencil (ID id, UID grid_range, uindex_t iteration, uindex_t subiteration, TimeDependentValue tdv) | |
Create a new stencil with an uninitialized buffer. | |
Stencil (ID id, UID grid_range, uindex_t iteration, uindex_t subiteration, TimeDependentValue tdv, Cell raw[diameter][diameter]) | |
Create a new stencil with the given contents. | |
Cell const & | operator[] (ID id) const |
Access a cell in the stencil. | |
Cell & | operator[] (ID id) |
Access a cell in the stencil. | |
Cell const & | operator[] (StencilID id) const |
Access a cell in the stencil. | |
Cell & | operator[] (StencilID id) |
Access a cell in the stencil. | |
Cell const & | operator[] (UID id) const |
Access a cell in the stencil. | |
Cell & | operator[] (UID id) |
Access a cell in the stencil. | |
Cell const & | operator[] (StencilUID id) const |
Access a cell in the stencil. | |
Cell & | operator[] (StencilUID id) |
Access a cell in the stencil. | |
Public Attributes | |
const ID | id |
The position of the central cell in the global grid. | |
const uindex_t | iteration |
The present iteration index of the cells in the stencil. | |
const uindex_t | subiteration |
The present sub-iteration index of the cells in the stencil. | |
const UID | grid_range |
The range of the underlying grid. | |
const TimeDependentValue | time_dependent_value |
The time-dependent value for this iteration. | |
Static Public Attributes | |
static constexpr uindex_t | diameter = 2 * stencil_radius + 1 |
The diameter (aka width and height) of the stencil buffer. | |
static constexpr unsigned long | bits_stencil = std::bit_width(diameter) |
The number of bits necessary to express column and row indices in the stencil. | |
The stencil buffer.
The stencil buffer contains the extended Moore neighborhood of a central cell and is used by a transition function to calculate the next iteration of the central cell.
This implementation provides two ways to index the stencil: With an ID
and a UID
. Since ID
is signed, the column and row axes are within the range of [-radius : radius]. Therefore, (0,0) points to the central cell. UID
is unsigned and the column and row axes are within the range of [0 : 2*radius + 1). Therefore, (0,0) points to the north-western corner of the stencil.
Cell | The type of cells in the stencil |
stencil_radius | The radius of the stencil, i.e. the extent of the stencil in each direction from the central cell. |
TimeDependentValue | The type of values provided by the TDV system. |
using stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::index_stencil_t = ac_int<bits_stencil, true> |
A signed index type for column and row indices in this stencil.
using stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::StencilID = GenericID<index_stencil_t> |
A signed, two-dimensional index to address cells in this stencil.
using stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::StencilUID = GenericID<uindex_stencil_t> |
An unsigned, two-dimensional index to address cells in this stencil.
using stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::uindex_stencil_t = ac_int<bits_stencil, false> |
An unsigned index type for column and row indices in this stencil.
|
inline |
Create a new stencil with an uninitialized buffer.
id | The position of the central cell in the global grid. |
grid_range | The range of the underlying grid. |
iteration | The present iteration index of the cells in the stencil. |
subiteration | The present sub-iteration index of the cells in the stencil. |
tdv | The time-dependent value for this iteration. |
|
inline |
Create a new stencil with the given contents.
id | The position of the central cell in the global grid. |
grid_range | The range of the underlying grid. |
iteration | The present iteration index of the cells in the stencil. |
subiteration | The present sub-iteration index of the cells in the stencil. |
tdv | The time-dependent value for this iteration. |
raw | An array of cells, which is copied into the stencil object. |
|
inline |
Access a cell in the stencil.
Since the indices in id
are signed, the origin of this index operator is the central cell.
|
inline |
Access a cell in the stencil.
Since the indices in id
are signed, the origin of this index operator is the central cell.
|
inline |
Access a cell in the stencil.
Since the indices in id
are signed, the origin of this index operator is the central cell.
|
inline |
Access a cell in the stencil.
Since the indices in id
are signed, the origin of this index operator is the central cell.
|
inline |
Access a cell in the stencil.
Since the indices in id
are unsigned, the origin of this index operator is the north-western corner.
|
inline |
Access a cell in the stencil.
Since the indices in id
are unsigned, the origin of this index operator is the north-western corner.
|
inline |
Access a cell in the stencil.
Since the indices in id
are unsigned, the origin of this index operator is the north-western corner.
|
inline |
Access a cell in the stencil.
Since the indices in id
are unsigned, the origin of this index operator is the north-western corner.
|
staticconstexpr |
The number of bits necessary to express column and row indices in the stencil.
|
staticconstexpr |
The diameter (aka width and height) of the stencil buffer.
const UID stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::grid_range |
The range of the underlying grid.
const ID stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::id |
The position of the central cell in the global grid.
const uindex_t stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::iteration |
The present iteration index of the cells in the stencil.
const uindex_t stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::subiteration |
The present sub-iteration index of the cells in the stencil.
const TimeDependentValue stencil::Stencil< Cell, stencil_radius, TimeDependentValue >::time_dependent_value |
The time-dependent value for this iteration.