StencilStream v3.0.0
SYCL-based Stencil Simulation Framework Targeting FPGAs
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size > 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, word_size >
 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.
 

Detailed Description

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t max_grid_width = 1024, uindex_t max_grid_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy, uindex_t word_size = 64>
class stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size >

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. Since the underlying FPGA design follows the Monotile architecture (See monotile), an instance of this updater template can only process grids up to the defined max_grid_width and max_grid_height.

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.
max_grid_width(Optimization parameter) The maximally supported grid width. For best hardware utilization, this should be a power of two. Increase this parameter to the maximum your application is expected to handle. However, higher maximal grid width might lead to increased logic and space usage as well as decreased clock frequencies.
max_grid_height(Optimization parameter) The maximally supported grid height. Increase this parameter to the maximum your application is expected to handle. However, increasing the maximal grid height will increase the BRAM usage of each PE.
TDVStrategy(Optimization parameter) The precomputation strategy for the time-dependent value system.
word_size(Optimization parameter) The width of the global memory channel, in bytes. For DDR-based systems, this should be 512 bits, or 64 bytes.

Member Typedef Documentation

◆ GridImpl

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t max_grid_width = 1024, uindex_t max_grid_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy, uindex_t word_size = 64>
using stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size >::GridImpl = Grid<Cell, word_size>

Shorthand for the used and supported grid type.

Constructor & Destructor Documentation

◆ StencilUpdate()

template<concepts::TransitionFunction F, uindex_t n_processing_elements = 1, uindex_t max_grid_width = 1024, uindex_t max_grid_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy, uindex_t word_size = 64>
stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size >::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 max_grid_width = 1024, uindex_t max_grid_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy, uindex_t word_size = 64>
double stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size >::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 max_grid_width = 1024, uindex_t max_grid_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy, uindex_t word_size = 64>
uindex_t stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size >::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 max_grid_width = 1024, uindex_t max_grid_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy, uindex_t word_size = 64>
Params & stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size >::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 max_grid_width = 1024, uindex_t max_grid_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy, uindex_t word_size = 64>
double stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size >::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 max_grid_width = 1024, uindex_t max_grid_height = 1024, tdv::single_pass::Strategy< F, n_processing_elements > TDVStrategy = tdv::single_pass::InlineStrategy, uindex_t word_size = 64>
GridImpl stencil::monotile::StencilUpdate< F, n_processing_elements, max_grid_width, max_grid_height, TDVStrategy, word_size >::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.


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