![]() |
Documentation a537f1bdf2
|
Declaration of the block-sparse matrix class. The implemtation is in CSysMatrix.cpp. More...
#include "../CConfig.hpp"#include "../code_config.hpp"#include "CSysVector.hpp"#include "CPastixWrapper.hpp"#include "../toolboxes/graph_toolbox.hpp"#include <cstdint>#include <cstdlib>#include <vector>#include <cassert>#include <optional>Go to the source code of this file.
Classes | |
| struct | CSysMatrixComms |
| Helper to communicate distributed vectors. More... | |
| struct | CBlockView< ScalarType > |
View of one matrix block, const-correct via the ScalarType template parameter. CBlockView<const ScalarType> is read-only; CBlockView<ScalarType> is mutable and exposes apply<Overwrite>(f) for writing with on-the-fly quantized encoding. Evaluates to false if the block is absent from the sparsity pattern. More... | |
| class | CSysMatrix< ScalarType > |
| Main class for defining block-compressed-row-storage sparse matrices. More... | |
Macros | |
| #define | EQR_PASSIVE(ROW, COL) SU2_TYPE::PassiveValue(f(ROW, COL)) |
| #define | GET_BLOCK_VIEW_IMPL |
Functions | |
| float | DecodeQuantScale (uint8_t e) noexcept |
Reconstruct the float row-scale from a stored uint8 binary exponent. e is stored already biased, i.e. it is the IEEE 754 biased-exponent field itself, so shifting it into place with a zero mantissa gives the exact power of two 2^(e-127). This is the inverse of the encoding in EncodeQuantBlock. | |
| template<class F > | |
| void | EncodeQuantRow (const F &f, uint8_t &qs, int8_t *__restrict qv, unsigned long nVar, unsigned long r) noexcept |
Encode one row of an nVar×nVar block into int8 quantized storage: qs receives the row's scale exponent, qv (nVar entries) the clamped int8 values for row r. f(r,c) is called twice per entry (max-abs scan then encoding); it should be cheap. | |
| template<class F > | |
| void | EncodeQuantBlock (const F &f, uint8_t *__restrict qs, int8_t *__restrict qv, unsigned long nVar) noexcept |
| Encode one nVar×nVar block into per-row int8 quantized storage, see EncodeQuantRow (each row's scale/quantization is independent, this just loops over all of them serially for the host path). | |
Declaration of the block-sparse matrix class. The implemtation is in CSysMatrix.cpp.
SU2 Project Website: https://su2code.github.io
The SU2 Project is maintained by the SU2 Foundation (http://su2foundation.org)
Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
SU2 is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
SU2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with SU2. If not, see http://www.gnu.org/licenses/.
| #define EQR_PASSIVE | ( | ROW, | |
| COL | |||
| ) | SU2_TYPE::PassiveValue(f(ROW, COL)) |
| #define GET_BLOCK_VIEW_IMPL |
|
inlinenoexcept |
Reconstruct the float row-scale from a stored uint8 binary exponent. e is stored already biased, i.e. it is the IEEE 754 biased-exponent field itself, so shifting it into place with a zero mantissa gives the exact power of two 2^(e-127). This is the inverse of the encoding in EncodeQuantBlock.
|
inlinenoexcept |
Encode one nVar×nVar block into per-row int8 quantized storage, see EncodeQuantRow (each row's scale/quantization is independent, this just loops over all of them serially for the host path).
|
inlinenoexcept |
Encode one row of an nVar×nVar block into int8 quantized storage: qs receives the row's scale exponent, qv (nVar entries) the clamped int8 values for row r. f(r,c) is called twice per entry (max-abs scan then encoding); it should be cheap.
f's return type is cast to float directly on device (only ever instantiated there for plain ScalarType, never AD-active); on host it goes through SU2_TYPE::PassiveValue first, since ScalarType can be AD-active there (quantized_mode is only compiled out for reverse-mode AD, not forward-mode, see quantized_offdiag_needed in CSysMatrix.cpp) and PassiveValue is host-only (not SU2_CUDA_HOST_DEVICE).