StencilStream v3.0.0
SYCL-based Stencil Simulation Framework Targeting FPGAs
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy > Class Template Reference

A grid updater that applies an iterative stencil code to a grid. More...

#include <StencilUpdate.hpp>

Classes

struct  Params
 Parameters for the stencil updater. More...
 

Public Types

using GridImpl = Grid< Cell, tile_width, tile_height, halo_radius >
 A shorthand for the used and supported grid type.
 

Public Member Functions

 StencilUpdate (Params params)
 Create a new stencil updater object.
 
Paramsget_params ()
 Return a reference to the parameters.
 
GridImpl operator() (GridImpl &source_grid)
 Compute a new grid based on the source grid, using the configured transition function.
 
uindex_t get_n_processed_cells () const
 Return the accumulated total number of cells processed by this updater.
 
double get_kernel_runtime () const
 Return the accumulated total runtime of the execution kernel.
 
double get_walltime () const
 Return the accumulated runtime of the updater, measured from the host side.
 

Static Public Attributes

static constexpr uindex_t halo_radius = F::stencil_radius * n_processing_elements
 The radius of an input's tile halo.
 

Detailed Description

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
class stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >

A grid updater that applies an iterative stencil code to a grid.

This updater applies an iterative stencil code, defined by the template parameter F, to the grid; As often as requested.

Template Parameters
FThe transition function to apply to input grids.
n_processing_elements(Optimization parameter) The number of processing elements (PEs) to implement. Increasing the number of PEs leads to a higher performance since more iterations are computed in parallel. However, it will also increase the resource and space usage of the design. Too many PEs might also decrease the clock frequency.
tile_width(Optimization parameter) The width of the tile that is updated in one pass. For best hardware utilization, this should be a power of two. Increasing the maximal width of a tile may increase the performance of the design by introducing longer steady-states and reducing halo computation overheads. However, it will also increase the logic resource utilization and might lower the clock frequency.
tile_height(Optimization parameter) The height of the tile that is updated in one pass. Increasing the maximal height of a tile may increase the performance of the design by introducing longer steady-states and reducing halo computation overheads. However, it will also increase the logic and on-chip memory utilization and might lower the clock frequency.
TDVStrategy(Optimization parameter) The precomputation strategy for the time-dependent value system (See guide).

Member Typedef Documentation

◆ GridImpl

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
using stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >::GridImpl = Grid<Cell, tile_width, tile_height, halo_radius>

A shorthand for the used and supported grid type.

Constructor & Destructor Documentation

◆ StencilUpdate()

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >::StencilUpdate ( Params  params)
inline

Create a new stencil updater object.

Member Function Documentation

◆ get_kernel_runtime()

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
double stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >::get_kernel_runtime ( ) const
inline

Return the accumulated total runtime of the execution kernel.

This runtime is accumulated across multiple calls to operator()(). However, this is only possible if Params::profiling is set to true.

◆ get_n_processed_cells()

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
uindex_t stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >::get_n_processed_cells ( ) const
inline

Return the accumulated total number of cells processed by this updater.

For each call of to operator()(), this is the width times the height of the grid, times the number of computed iterations. This will also be accumulated across multiple calls to operator()().

◆ get_params()

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
Params & stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >::get_params ( )
inline

Return a reference to the parameters.

Modifications to the parameters struct will be used in the next call to operator()().

◆ get_walltime()

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
double stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >::get_walltime ( ) const
inline

Return the accumulated runtime of the updater, measured from the host side.

For each call to operator()(), the time it took to submit all kernels and, if Params::blocking is true, to finish the computation is recorded and accumulated.

◆ operator()()

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
GridImpl stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >::operator() ( GridImpl source_grid)
inline

Compute a new grid based on the source grid, using the configured transition function.

The computation does not work in-place. Instead, it will allocate two additional grids with the same size as the source grid and use them for a double buffering scheme. Therefore, you are free to reuse the source grid as it will not be altered.

If Params::blocking is set to true, this method will block until the computation is complete. Otherwise, it will return as soon as all kernels are submitted.

Member Data Documentation

◆ halo_radius

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t tile_width = 1024, uindex_t tile_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy>
constexpr uindex_t stencil::tiling::StencilUpdate< F, n_processing_elements, tile_width, tile_height, TDVStrategy >::halo_radius = F::stencil_radius * n_processing_elements
staticconstexpr

The radius of an input's tile halo.


The documentation for this class was generated from the following file: