Specifications - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

There is a configuration class derived from the base configuration class xf::solver::svdTraits by redefining the appropriate class member.

struct my_svd_config : xf::solver::svdTraits<ROWS, COLS, MATRIX_IN_T, MATRIX_OUT_T> {
    static const int ARCH = SEL_ARCH;
};

The base configuration class is:

template <int RowsA, int ColsA, typename InputType, typename OutputType>
struct svdTraits {
    typedef OutputType SIntType;
    typedef OutputType UIntType;
    typedef OutputType VIntType;
    typedef OutputType CSIntType;
    static const int NUM_SWEEPS = 10;
    static const int MIN_DIM = (RowsA < ColsA ? RowsA : ColsA);
    static const int ARCH = 1;
    static const int OFF_DIAG_II = 8;
    static const int DIAG_II = 8;
};

Note

  • NUM_SWEEPS: The SVD function uses the iterative two-sided Jacobi method. Literature typically suggests 6 to 10 iterations to successfully converge.
  • ARCH: Select implementation. 0 = Basic loop engine. 1 = Pairs based engine.
  • OFF_DIAG_II: Specify the pipelining target for the off diagonal loop.
  • DIAG_II: Specify the pipelining target for the diagonal loop.

The configuration class is supplied to the xf::solver::svd function as a template paramter as follows.

template <int RowsA,
          int ColsA,
          typename InputType,
          typename OutputType,
          typename SVDTraits = svdTraits<RowsA, ColsA, InputType, OutputType> >
svd(hls::stream<InputType >& matrixAStrm,
    hls::stream<OutputType>& matrixSStrm,
    hls::stream<OutputType>& matrixUStrm,
    hls::stream<OutputType>& matrixVStrm)