template class xf::fintech::internal::StreamWrapper

#include "fd_solver.hpp"

Overview

Utility class to encapsulate the multiplier elements.

template <
    typename DT,
    unsigned int MEM_WIDTH,
    unsigned int INDEX_WIDTH,
    unsigned int A_SIZE,
    unsigned int M_SIZE,
    unsigned int LOG2_M_SIZE,
    unsigned int DIM2_SIZE1 = 3,
    unsigned int DIM2_SIZE2 = 5
    >
class StreamWrapper

// typedefs

typedef xf::fintech::blas::WideType <DT, MEM_WIDTH> WideDataType
typedef hls::stream <WideDataType> WideStreamType

Methods

StreamWrapper

StreamWrapper ()

default constructor

streamDimv3

void streamDimv3 (
    DT A1 [M_SIZE][DIM2_SIZE1],
    DT u [M_SIZE],
    DT rhs1_tmp0 [M_SIZE],
    WideStreamType& u_out
    )

Computes multiplication of tridiagonal matrix by a vector.

Parameters:

A1 M x 3 array holding lower/main/upper diagonals of A1 tridiagonal matrix
u Vector to be multiplied
rhs1_tmp0 Multiplication result
u_out Stream form of U to pass to pentadiagonal multiplier

streamDimv5

void streamDimv5 (
    DT A2 [M_SIZE][DIM2_SIZE2],
    WideStreamType& u_in,
    unsigned int m1,
    unsigned int m2,
    DT rhs2_tmp0 [M_SIZE],
    WideStreamType& u_out
    )

Computes multiplication of pentadiagonal matrix by a vector.

Parameters:

A2 M x 5 array holding lower/main/upper diagonals of A2 tridiagonal matrix
u_in Vector to be multiplied [stream format]
m1 Size of array [0..m1-1] in S direction
m2 Size of array [0..m2-1] in V direction
rhs2_tmp0 Multiplication result
u_out Vector output [stream format]

streamSparseMultAdd

void streamSparseMultAdd (
    DT A [A_SIZE],
    unsigned int Ar [A_SIZE],
    unsigned int Ac [A_SIZE],
    WideStreamType& u_in,
    DT b [M_SIZE],
    unsigned int Annz,
    unsigned int M,
    DT y0 [M_SIZE]
    )

Computes multiplication of sparse matrix by vector plus a constant.

Parameters:

A Sparse matrix value
Ar Sparse matrix row
Ac Sparse matrix column
u_in Vector to be multiplied [stream format]
b Vector to be added after sparse-mult stage
Annz Number of non-zeros in sparse matrix (how many elements of A/Ar/Ac are valid)
M Matrix M-size === (m1+1) x (m2+1)
y0 Result of mult-add in flattened S-inner form

parallelBlocks

void parallelBlocks (
    DT A [A_SIZE],
    unsigned int Ar [A_SIZE],
    unsigned int Ac [A_SIZE],
    DT u [M_SIZE],
    DT b [M_SIZE],
    unsigned int Annz,
    unsigned int M,
    DT A1 [M_SIZE][DIM2_SIZE1],
    DT A2 [M_SIZE][DIM2_SIZE2],
    unsigned int m1,
    unsigned int m2,
    DT y0 [M_SIZE],
    DT rhs1_tmp0 [M_SIZE],
    DT rhs2_tmp0 [M_SIZE]
    )

Wrapper function to combine multipliers into a dataflow region and allow parallelization.