docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::einsum::EinsumIndexing Struct Reference

How the consumed einsum dimensions map onto one operand's access subset. More...

#include <sdfg/einsum/einsum_detection.h>

Public Member Functions

std::vector< symbolic::Expression > get_strides (const std::vector< EinsumIndexContribution > &ordered_contributions, const std::vector< symbolic::Expression > &shape) const
 Compute all strides for shape, given this indexing's contributions reordered so that ordered_contributions[d] corresponds to shape dimension d (outer -> inner).

Public Attributes

std::vector< EinsumIndexContribution > contributions
 Contributions of individual dimensions to this operand's index positions.
size_t covered = 0
 Number of innermost original index positions fully covered by the dimensions.

Detailed Description

How the consumed einsum dimensions map onto one operand's access subset.

Records, per operand, which dimensions contribute to which original index position (and with which factor), plus how many of the original subset's index positions - counted from the innermost outward - are fully reconstructed by those contributions. The outermost subset.size() - covered positions are outer/irrelevant to the einsum operation.

Member Function Documentation

◆ get_strides()

std::vector< symbolic::Expression > sdfg::einsum::EinsumIndexing::get_strides ( const std::vector< EinsumIndexContribution > & ordered_contributions,
const std::vector< symbolic::Expression > & shape ) const

Compute all strides for shape, given this indexing's contributions reordered so that ordered_contributions[d] corresponds to shape dimension d (outer -> inner).

Walks the subset positions from innermost outward (like TensorLayout::linear_strides): dimensions sharing a subset position are linearized, so their relative stride comes from the contribution factor; crossing into an outer subset position advances by that position's extent.

Member Data Documentation

◆ contributions

std::vector<EinsumIndexContribution> sdfg::einsum::EinsumIndexing::contributions

Contributions of individual dimensions to this operand's index positions.

◆ covered

size_t sdfg::einsum::EinsumIndexing::covered = 0

Number of innermost original index positions fully covered by the dimensions.


The documentation for this struct was generated from the following file: