|
ADS
Algorithms and Data Structures
|
A sparse matrix in the format SELL- \( C \)- \( \sigma \) of Kreutzer, Hager, Wellein, Fehske and Bishop, beyond the book: the rows, sorted by their number of nonzeros within windows of \( \sigma \) consecutive rows, go in chunks of \( C \) rows, and each chunk keeps its nonzeros by columns of the chunk, the \( k \)-th nonzero of its \( C \) rows side by side, padded with zeros to the longest of its rows. More...
#include "ADS/Contract.h"#include "ADS/numeric/CsrMatrix.h"#include <algorithm>#include <cstddef>#include <cstdint>#include <numeric>#include <vector>#include "ADS/numeric/impl/SellMatrix.tpp"Go to the source code of this file.
Classes | |
| class | ADS::SellMatrix< C > |
| a sparse matrix of doubles in SELL- \( C \)- \( \sigma \), chunks of \( C \) rows (4 by default, the fastest on a Xeon Gold 5120 with AVX-512: the gathers of 8 lanes cost more than they save) More... | |
Namespaces | |
| namespace | ADS |
A sparse matrix in the format SELL- \( C \)- \( \sigma \) of Kreutzer, Hager, Wellein, Fehske and Bishop, beyond the book: the rows, sorted by their number of nonzeros within windows of \( \sigma \) consecutive rows, go in chunks of \( C \) rows, and each chunk keeps its nonzeros by columns of the chunk, the \( k \)-th nonzero of its \( C \) rows side by side, padded with zeros to the longest of its rows.
The product \( y = A x \) then runs the \( C \) rows of a chunk in the \( C \) lanes of the vector registers (\( C = 8 \) doubles for AVX-512, 4 for AVX2), the values and the columns of a step loaded in one stream and \( x \) gathered, instead of one row at a time with a reduction at its end, as in CSR [see CsrMatrix.h]. The sort within the windows makes the rows of a chunk nearly as long, so that the padding, \( \sum_c C \max_{i \in c} r_i - \mathit{nnz} \) for the chunks \( c \) and the row lengths \( r_i \), is small (none on the rows of equal length of a stencil), while a window of \( \sigma \ll m \) rows keeps the rows near their place and so the reads of \( x \) and the writes of \( y \) near each other.
The contracts [see Contract.h]: \( \sigma \ge 1 \) and \( m < 2^{32} \); \( x \) has \( n \) entries and \( y \) \( m \) entries. The functions are defined in SellMatrix.tpp.