|
TDLS 0.4.0
Tiny Device-callable Linear Solvers
|
Shape and compile-time configuration of the ArrowheadLUpp solver family. More...
#include <type_traits>#include <tdls/core/macros.hpp>#include <tdls/core/structural_real.hpp>#include <tdls/solvers/options.hpp>#include <tdls/solvers/tiled_lupp/config.hpp>Go to the source code of this file.
Classes | |
| struct | tdls::ArrowheadShape |
| Shape of an arrowhead matrix: a template argument of the compile-time solver, a function argument of the runtime one. More... | |
| struct | tdls::ArrowheadLUppConfig< T > |
| Compile-time knobs of the ArrowheadLUpp solvers, carrying the tuned defaults. More... | |
Enumerations | |
| enum class | tdls::ArrowheadStorage { Full , Packed , Csr , Bsr } |
| Storage of an arrowhead matrix. More... | |
| enum class | tdls::ArrowheadCoupling { Dense , Diagonal } |
| Pattern of the border-to-block couplings A_bk, the entries of the border rows in the columns of a block. More... | |
| enum class | tdls::ArrowheadCondensation { MinFlops , MinTraffic } |
| Condensation of an accepted block: what its Schur update and its recovery data spare, flops or memory traffic (ArrowheadLUppConfig::condensation). More... | |
Functions | |
| template<typename T > | |
| constexpr TiledLUppConfig< T > | tdls::detail::arrowhead_block_config (const ArrowheadLUppConfig< T > &config) noexcept |
| TiledLUpp configuration of the diagonal blocks of an ArrowheadLUpp solver. | |
| template<typename T > | |
| constexpr TiledLUppConfig< T > | tdls::detail::arrowhead_physical_block_config (const ArrowheadLUppConfig< T > &config) noexcept |
| TiledLUpp configuration of the diagonal blocks eliminated in registers: that of arrowhead_block_config with physical row interchanges (the whole block one tile, every index known at compile time). | |
| template<typename T > | |
| TDLS_HOST_DEVICE constexpr bool | tdls::detail::arrowhead_register_blocks (const ArrowheadLUppConfig< T > &config, const int S) noexcept |
| Whether the diagonal blocks of S unknowns are eliminated in registers (ArrowheadLUppConfig::block_row_interchange, Auto resolved). | |
| template<typename T > | |
| TDLS_HOST_DEVICE constexpr int | tdls::detail::arrowhead_rhs_pass_width (const ArrowheadLUppConfig< T > &config, const bool reg) noexcept |
| The width of the passes over [A_kb | y_k] (ArrowheadLUppConfig::rhs_pass_width), -1 resolved: 2 on GPU with the blocks in registers, whatever the layout, 0 (one pass) otherwise. | |
| template<typename T > | |
| TDLS_HOST_DEVICE constexpr bool | tdls::detail::arrowhead_register_blocks_here (const RowInterchange interchange, const int S) noexcept |
| Whether the diagonal blocks of S unknowns are eliminated in registers, decided at run time on the side of the code (detail::physical_rows_here): the choice of the runtime solver. | |
| TDLS_HOST_DEVICE constexpr int | tdls::detail::arrowhead_rhs_pass_width_here (const int width, const bool reg) noexcept |
| arrowhead_rhs_pass_width decided at run time on the side of the code, as arrowhead_register_blocks_here. | |
| template<typename T , bool gpu> | |
| constexpr ArrowheadLUppConfig< T > | tdls::detail::arrowhead_resolved_config (ArrowheadLUppConfig< T > config, const int S) noexcept |
| The configuration with the choices of the given hardware made explicit: block_row_interchange Physical or Logical, rhs_pass_width non-negative (the delegation of the side dispatch of nvc++). | |
| template<typename T > | |
| constexpr TiledLUppConfig< T > | tdls::detail::arrowhead_border_config (const ArrowheadLUppConfig< T > &config) noexcept |
| TiledLUpp configuration of the border system of an ArrowheadLUpp solver, a local row-major array whatever the layout. | |
Shape and compile-time configuration of the ArrowheadLUpp solver family.
An arrowhead matrix, or bordered block-diagonal matrix, has border unknowns first, then blocks diagonal blocks of block unknowns:
[ Abb Ab0 Ab1 ... ] [ A0b D0 ] [ A1b D1 ] [ ... ... ]
Two blocks never couple. ArrowheadShape holds the four integers of this pattern; it is a template argument of the compile-time solver and a function argument of the runtime one, as the dimension N of TiledLUpp. Every knob is a member of the ArrowheadLUppConfig aggregate, passed as the Config non-type template argument of both solvers, with designated initializers in declaration order:
constexpr auto config = tdls::ArrowheadLUppConfig<double>{ .coupling = tdls::ArrowheadCoupling::Diagonal, .storage = tdls::ArrowheadStorage::Packed};
Both aggregates are structural types: every member is public, and two values with equal members name the same instantiation. The floating-point knobs are held as tdls::StructuralReal values, as in the other families.
|
strong |
Condensation of an accepted block: what its Schur update and its recovery data spare, flops or memory traffic (ArrowheadLUppConfig::condensation).
The two differ under the row-major layout with the dense coupling only. The other paths run the whole solve W_k = D_k^-1 [A_kb | y_k] either way: under the diagonal coupling it already costs fewer flops than the update by the multipliers, and under the column-major layout it is the only path.
|
strong |
|
strong |
Storage of an arrowhead matrix.
Every storage holds the entries of the arrowhead pattern, the zeros inside the stored blocks included. The pattern is known from the shape, so the position of every entry is computed, never looked up: Csr and Bsr need no index array at run time. ArrowheadStorageMap computes the positions, and writes the canonical index arrays of Csr and Bsr, to build or check a matrix in these formats. Each storage reads by rows under the row-major layout and by columns under the column-major one.
|
nodiscardconstexprnoexcept |
TiledLUpp configuration of the diagonal blocks of an ArrowheadLUpp solver.
| T | scalar type |
| [in] | config | configuration of the ArrowheadLUpp solver |
|
nodiscardconstexprnoexcept |
TiledLUpp configuration of the border system of an ArrowheadLUpp solver, a local row-major array whatever the layout.
| T | scalar type |
| [in] | config | configuration of the ArrowheadLUpp solver |
|
nodiscardconstexprnoexcept |
TiledLUpp configuration of the diagonal blocks eliminated in registers: that of arrowhead_block_config with physical row interchanges (the whole block one tile, every index known at compile time).
| T | scalar type |
| [in] | config | configuration of the ArrowheadLUpp solver |
|
nodiscardconstexprnoexcept |
Whether the diagonal blocks of S unknowns are eliminated in registers (ArrowheadLUppConfig::block_row_interchange, Auto resolved).
| T | scalar type |
| [in] | config | configuration of the ArrowheadLUpp solver |
| [in] | S | unknowns of a block |
|
nodiscardconstexprnoexcept |
Whether the diagonal blocks of S unknowns are eliminated in registers, decided at run time on the side of the code (detail::physical_rows_here): the choice of the runtime solver.
The runtime helpers take the fields of the configuration by value: a configuration given as a template argument and bound to a reference at run time needs the storage of the template parameter object on the device, which nvc++ does not emit (the image is then rejected when loaded).
| T | scalar type |
| [in] | interchange | ArrowheadLUppConfig::block_row_interchange |
| [in] | S | unknowns of a block |
|
nodiscardconstexprnoexcept |
The configuration with the choices of the given hardware made explicit: block_row_interchange Physical or Logical, rhs_pass_width non-negative (the delegation of the side dispatch of nvc++).
| T | scalar type |
| gpu | the hardware: GPU (true) or CPU (false) |
| [in] | config | configuration of the ArrowheadLUpp solver |
| [in] | S | unknowns of a block |
|
nodiscardconstexprnoexcept |
The width of the passes over [A_kb | y_k] (ArrowheadLUppConfig::rhs_pass_width), -1 resolved: 2 on GPU with the blocks in registers, whatever the layout, 0 (one pass) otherwise.
| T | scalar type |
| [in] | config | configuration of the ArrowheadLUpp solver |
| [in] | reg | whether the blocks are eliminated in registers |
|
nodiscardconstexprnoexcept |
arrowhead_rhs_pass_width decided at run time on the side of the code, as arrowhead_register_blocks_here.
| [in] | width | ArrowheadLUppConfig::rhs_pass_width |
| [in] | reg | whether the blocks are eliminated in registers |