|
| template<Layout LB> |
| | GemmPlan (const NDArray< T, 2, LB > &B, Pool pool) |
| | Construct the plan and fully pre-pack B into m_Bp.
|
| template<Layout LA> |
| void | execute (const NDArray< T, 2, LA > &A, NDArray< T, 2 > &C, T alpha=T{1}, T beta=T{0}) const noexcept |
| | Execute the plan: compute C := alpha * A * B + beta * C against the pre-packed B captured at construction.
|
| std::size_t | kDim () const noexcept |
| | Inner dimension captured at construction (B.rows).
|
| std::size_t | nDim () const noexcept |
| | Column count captured at construction (B.cols).
|
| const T * | debugBpData () const noexcept |
| | Debug accessor exposing the packed B pointer so tests can pin alignment.
|
| std::size_t | debugScratchSize () const noexcept |
| | Debug accessor exposing the scratch capacity so tests can pin the sizing formula.
|
| | GemmPlan (const GemmPlan &)=delete |
| GemmPlan & | operator= (const GemmPlan &)=delete |
| | GemmPlan (GemmPlan &&) noexcept=default |
| | Defaulted move constructor; transfers the packed B panel and scratch.
|
| GemmPlan & | operator= (GemmPlan &&) noexcept=default |
| | Defaulted move assignment; transfers the packed B panel and scratch.
|
| | ~GemmPlan ()=default |
template<class T, class Backend = detail::ReferenceGemm>
class clustering::math::GemmPlan< T, Backend >
Reusable GEMM plan: packs B once at construction, amortizes the packing cost across repeated execute calls with varying A.
Ownership model:
m_Bp holds a packB-shaped copy of B covering every (jcIdx, pcIdx) block; the source B may be destroyed after construction.
m_scratch holds per-worker A-packing arenas sized workerCount * kMc * kKc.
m_pool is captured by value at construction. execute uses it unchanged.
Concurrency: execute is const with respect to the plan's observable shape but mutates m_scratch via pointer aliasing into the per-worker slice. Two concurrent execute calls on the same plan alias the same scratch; callers that pipeline across application threads construct one plan per thread.
Lifetime: move-only. m_Bp and m_scratch are std::vector; move is noexcept.
- Template Parameters
-
| T | Element type (float or double). |
| Backend | Backend tag; defaulted to detail::ReferenceGemm. GemmPlan does NOT route through the backend – it calls gemmRunPrepacked directly with its owned m_Bp. The template parameter exists so GemmPlan is selected at the same <T, Backend> call site as the one-shot gemm entry. |
Definition at line 40 of file gemm_plan.h.