There is a configuration class derived from the base configuration class xf::solver::choleskyTraits by redefining the appropriate class member.
struct my_cholesky_traits : xf::solver::choleskyTraits<LOWER_TRIANGULAR, DIM, MATRIX_IN_T, MATRIX_OUT_T> {
static const int ARCH = SEL_ARCH;
};
The default base configuration class is as following. If the input datatype is complex or ap_fixed, please refer to L1/include/hw/cholesky.hpp for more details.
template <bool LowerTriangularL, int RowsColsA, typename InputType, typename OutputType>
struct choleskyTraits {
typedef InputType PROD_T;
typedef InputType ACCUM_T;
typedef InputType ADD_T;
typedef InputType DIAG_T;
typedef InputType RECIP_DIAG_T;
typedef InputType OFF_DIAG_T;
typedef OutputType L_OUTPUT_T;
static const int ARCH = 1;
static const int INNER_II = 1;
static const int UNROLL_FACTOR = 1;
static const int UNROLL_DIM = (LowerTriangularL == true ? 1 : 2);
static const int ARCH2_ZERO_LOOP = true;
};
Note
- ARCH: Select implementation: 0=Basic, 1=Lower latency architecture, 2=Further improved latency architecture
- INNER_II: Specify the pipelining target for the inner loop
- UNROLL_FACTOR: The inner loop unrolling factor for the choleskyAlt2 architecture(2) to increase throughput
- UNROLL_DIM: Dimension to unroll matrix
- ARCH2_ZERO_LOOP: Additional implementation “switch” for the choleskyAlt2 architecture (2).
The configuration class is supplied to the xf::solver::cholesky function as a template paramter as follows.
template <bool LowerTriangularL,
int RowsColsA,
class InputType,
class OutputType,
typename TRAITS = choleskyTraits<LowerTriangularL, RowsColsA, InputType, OutputType> >
int cholesky(hls::stream<InputType>& matrixAStrm, hls::stream<OutputType>& matrixLStrm)