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.
- Header-only Library (Super Easy to Install and Use)
- Templated-based C++ Design:
Mat
andTensor
ClassesMatRef
andMatView
for Reference and View- (Relatively) Modern C++ Implementation (C++14/17)
- Hardware-friendly Design:
- Optimized RAM Usage
- Configurable Parallelism
- Optimized Matrix Operations
- Fully Open Source
Read 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 | auto D = A.diagMat_(); |
|
2 | auto E = A.offDiag_(); |
|
3 | auto D_I = D.inv(); |
|
4 | auto P = -D_I * E; |
|
5 |
|
auto X = P_ = P; |
6 | for (int i = 2; i <= n; ++i) { |
|
7 | P_ *= P; |
|
8 | X += P_; |
|
9 | } |
|
10 | 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]
@article{zhao2024flexible,
title = {Flexible High-Level Synthesis Library for Linear Transformations},
author = {Zhao, Wuqiong and Li, Changhan and Ji, Zhenhao and Guo, Zhichen and Chen, Xuanbo and You, You and Huang, Yongming and You, Xiaohu and Zhang, Chuan},
journal = {{IEEE} Transactions on Circuits and Systems {II}: Express Briefs},
volume = {71},
number = {7},
pages = {3348--3352},
year = {2024},
month = jul,
publisher = {IEEE}
}
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
git clone https://github.com/autohdw/flames.git
You can include the required header
#include "flames/core.hpp"
All classes and functions are under the flames
namespace, so you can use
using namespace flames;
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.