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::cpu::StencilUpdate< F > 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 >
 Shorthand for the used and supported grid type.
 

Public Member Functions

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

Detailed Description

template<concepts::TransitionFunction F>
class stencil::cpu::StencilUpdate< F >

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.

Member Typedef Documentation

◆ GridImpl

template<concepts::TransitionFunction F>
using stencil::cpu::StencilUpdate< F >::GridImpl = Grid<Cell>

Shorthand for the used and supported grid type.

Constructor & Destructor Documentation

◆ StencilUpdate()

template<concepts::TransitionFunction F>
stencil::cpu::StencilUpdate< F >::StencilUpdate ( Params  params)
inline

Create a new stencil updater object.

Member Function Documentation

◆ get_n_processed_cells()

template<concepts::TransitionFunction F>
uindex_t stencil::cpu::StencilUpdate< F >::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>
Params & stencil::cpu::StencilUpdate< F >::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>
double stencil::cpu::StencilUpdate< F >::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>
GridImpl stencil::cpu::StencilUpdate< F >::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: