#include <gpr/linalg/schemeii/SchemeII.h>
Classes | |
| struct | Impl |
Public Member Functions | |
| Context (Options options) | |
| ~Context () | |
| Context (const Context &)=delete | |
| Context & | operator= (const Context &)=delete |
| const Options & | options () const noexcept |
| std::string | describe (std::int64_t k) const |
| One line naming engine, provider, bits and moduli for k. | |
| Plan | plan (std::int64_t k) const |
| void | setThreadSource (int(*source)()) |
| Thread count used when Options::threads is zero. | |
| Operand | prepareRows (const double *a, std::int64_t lda, bool transpose, std::int64_t m, std::int64_t k, const Plan &plan, const int *exponents=nullptr) const |
| Row operand from op(A) (m x k). Exponents override the row maxima. | |
| Operand | prepareColumns (const double *b, std::int64_t ldb, bool transpose, std::int64_t k, std::int64_t n, const Plan &plan, const int *exponents=nullptr) const |
| Column operand from op(B) (k x n). | |
| void | run (std::span< const Task > tasks) const |
| void | gemm (bool transpose_a, bool transpose_b, std::int64_t m, std::int64_t n, std::int64_t k, double alpha, const double *a, std::int64_t lda, const double *b, std::int64_t ldb, double beta, double *c, std::int64_t ldc) const |
| void | residues (const Task &task, std::vector< std::uint32_t > &out) const |
| void | reconstruct (const Plan &plan, std::span< const std::uint32_t > residues, std::span< const int > row_exponents, std::span< const int > column_exponents, std::int64_t m, std::int64_t n, double alpha, double beta, double *c, std::int64_t ldc) const |
| C block from summed residues (see residues()). | |
Definition at line 151 of file SchemeII.h.
|
explicit |
Definition at line 1975 of file SchemeII.cpp.
|
default |
|
delete |
|
nodiscard |
One line naming engine, provider, bits and moduli for k.
Definition at line 2005 of file SchemeII.cpp.
| void gpr::linalg::schemeii::Context::gemm | ( | bool | transpose_a, |
| bool | transpose_b, | ||
| std::int64_t | m, | ||
| std::int64_t | n, | ||
| std::int64_t | k, | ||
| double | alpha, | ||
| const double * | a, | ||
| std::int64_t | lda, | ||
| const double * | b, | ||
| std::int64_t | ldb, | ||
| double | beta, | ||
| double * | c, | ||
| std::int64_t | ldc ) const |
C = alpha op(A) op(B) + beta C with column-major storage. Workspace is bounded by Options::panel_bytes plus the block residues.
Definition at line 2036 of file SchemeII.cpp.
|
nodiscardnoexcept |
Definition at line 1989 of file SchemeII.cpp.
|
nodiscard |
Definition at line 1999 of file SchemeII.cpp.
| Operand gpr::linalg::schemeii::Context::prepareColumns | ( | const double * | b, |
| std::int64_t | ldb, | ||
| bool | transpose, | ||
| std::int64_t | k, | ||
| std::int64_t | n, | ||
| const Plan & | plan, | ||
| const int * | exponents = nullptr ) const |
Column operand from op(B) (k x n).
Definition at line 2024 of file SchemeII.cpp.
| Operand gpr::linalg::schemeii::Context::prepareRows | ( | const double * | a, |
| std::int64_t | lda, | ||
| bool | transpose, | ||
| std::int64_t | m, | ||
| std::int64_t | k, | ||
| const Plan & | plan, | ||
| const int * | exponents = nullptr ) const |
Row operand from op(A) (m x k). Exponents override the row maxima.
Definition at line 2017 of file SchemeII.cpp.
| void gpr::linalg::schemeii::Context::reconstruct | ( | const Plan & | plan, |
| std::span< const std::uint32_t > | residues, | ||
| std::span< const int > | row_exponents, | ||
| std::span< const int > | column_exponents, | ||
| std::int64_t | m, | ||
| std::int64_t | n, | ||
| double | alpha, | ||
| double | beta, | ||
| double * | c, | ||
| std::int64_t | ldc ) const |
C block from summed residues (see residues()).
Definition at line 2119 of file SchemeII.cpp.
| void gpr::linalg::schemeii::Context::residues | ( | const Task & | task, |
| std::vector< std::uint32_t > & | out ) const |
Residues in [0, p_t) of A'B' for the block of a task, stored as out[t * m * n + i + j * m]. With a split inner dimension, sum these over the parts modulo p_t (exact in int64) and pass the sums to reconstruct(); prepare every part with the exponents of the whole rows and columns and the plan of the whole k.
Definition at line 2105 of file SchemeII.cpp.
| void gpr::linalg::schemeii::Context::run | ( | std::span< const Task > | tasks | ) | const |
Runs every task; the outputs must not overlap and all tasks share k. Throws on a non-finite result.
Definition at line 2031 of file SchemeII.cpp.
| void gpr::linalg::schemeii::Context::setThreadSource | ( | int(* | source )() | ) |
Thread count used when Options::threads is zero.
Definition at line 1994 of file SchemeII.cpp.