FLAMES 0.1.0
Matrix-Empowered HLS Library
|
Flexible Linear Algebra with Matrix-Empowered Synthesis (for Vitis HLS)
Developed by Wuqiong Zhao and other contributors, from LEADS, Southeast University. This is part of the AutoHDW project.
Mat
and Tensor
ClassesMatRef
and MatView
for Reference and ViewRead our paper for details (open access PDF).
Linear algebra algorithm implementation made easy by FLAMES! Here is the NSA algorithm and the corresponding implementation using FLAMES:
Step | Algorithm | FLAMES C++ Implementation |
---|---|---|
1 | \(\mathbf{D} = \mathbf{A} \circ \mathbf{I}\) | auto D = A.diagMat_(); |
2 | \(\mathbf{E} = \mathbf{A} - \mathbf{D}\) | auto E = A.offDiag_(); |
3 | \(\mathbf{D}_I = \mathbf{D}^{-1}\) | auto D_I = D.inv(); |
4 | \(\mathbf{P} = -\mathbf{D}_I \mathbf{E}\) | auto P = -D_I * E; |
5 | \(\mathbf{X} = \mathbf{P}\) (Iter. 1) | auto X = P_ = P; |
6 | \(\text{for } i = 2, \dots, n\) | for (int i = 2; i <= n; ++i) { |
7 | \(\quad \mathbf{P}^i = \mathbf{P}^{i-1} \mathbf{P}\) | P_ *= P; |
8 | \(\quad \mathbf{X} = \mathbf{X} + \mathbf{P}^i\) | X += P_; |
9 | \(\text{end}\) | } |
10 | \(\mathbf{A}^{-1} = \mathbf{X} \mathbf{D}_I + \mathbf{D}_I\) | A_inv = X * D_I + D_I; |
From Table 2 in our paper, code available at examples/mat-inv-nsa
.
If you find FLAMES useful, please cite our paper: Flexible High-Level Synthesis Library for Linear Transformations, IEEE TCAS-II, vol. 71, no. 7, pp. 3348-3352, Jul. 2024. [IEEE Xplore] [PDF] [DOI]
Since FLAMES is a modern library written using C++14 (with some C++17 features), it only supports Vitis HLS 2020 or later where the GCC compiler version is 6.2.0. Notably, Vivado HLS is not supported.
FLAMES is a header-only library, so you can easily use it by first cloning it under you project root with
You can include the required header
All classes and functions are under the flames
namespace, so you can use
to access classes Mat
, etc. directly instead of flames::Mat
.
You can find more information about FLAMES in FLAMES_Insight.pdf
.
The FLAMES is open source and distributed by an Apache license (v2.0). Please cite our paper if you use FLAMES in your research.