template class xf::hpc::rtm::Stencil2D

#include "stencil2d.hpp"

Overview

Stencil2D class defines isotrophic laplacian operation and time iterations function.

Parameters:

t_DataType the basic wavefield datatype
t_Order the spatial discretization order
t_MaxDim the maximum height this kernel can process
t_PE the number of processing elements
template <
    typename t_DataType,
    int t_Order,
    int t_MaxDim = 1024,
    int t_PE = 1
    >
class Stencil2D

    // direct descendants

    template <
        typename t_DataType,
        int t_Order,
        int t_MaxDim = 1024,
        int t_MaxB = 40,
        int t_PE = t_Order / 2
        >
    class xf::hpc::rtm::RTM2D

// typedefs

typedef blas::WideType <t_DataType, t_PE> t_WideType
typedef t_WideType::t_TypeInt t_InType
typedef blas::WideType <t_InType, t_NumData, t_WideType::t_TypeWidth> t_PairType
typedef t_PairType::t_TypeInt t_PairInType

// fields

static const unsigned int t_NumData
static const unsigned int t_HalfOrder
static const unsigned int t_FifoDepth

Methods

setCoef

void setCoef (
    const t_DataType* p_coefz,
    const t_DataType* p_coefx
    )

setCoef set the coefficients for stencil kernel

Parameters:

p_coefz the coefficents along z-direction
p_coefx the coefficents along x-direction

setDim

void setDim (
    const unsigned int p_z,
    const unsigned int p_x
    )

setDim set the dimension of the wavefields

Parameters:

p_z the dimension of z-direction
p_x the dimension of x-direction

laplacian

laplacian overload (1)

void laplacian (
    hls::stream <t_InType>& p_in,
    hls::stream <t_InType>& p_pin,
    hls::stream <t_InType>& p_out
    )

laplacian computes the laplacian of an given wavefield

Parameters:

p_in the input wavefield stream
p_pin a copy of p_in
p_out a stream of laplacian results

propagate

void propagate (
    hls::stream <t_InType>& p_v2dt2,
    hls::stream <t_InType>& p_cpvt,
    hls::stream <t_PairInType>& p_in,
    hls::stream <t_PairInType>& p_out,
    bool p_sw = false
    )

propagate computes the time iteration for FDTD

Parameters:

p_v2dt2 the pow(v * dt, 2)
p_cpvt a copy of p_v2dt2
p_in a stream of input wavefield
p_out a stream of output wavefield
p_sw a switch to swap outptu streams