docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::data_flow::TensorLayoutPattern Class Reference

A structured access described by a full affine tensor layout (shape, strides and offset in elements). More...

#include <sdfg/data_flow/pointer_metadata.h>

Inheritance diagram for sdfg::data_flow::TensorLayoutPattern:
[legend]

Public Member Functions

 TensorLayoutPattern (math::tensor::TensorLayout layout, bool not_sparse=false)
bool empty () const override
 There are no elements in this pattern = no accesses of this type.
bool every_element_accessed () const override
 Every element that is part of this pattern is actually accessed.
const math::tensor::TensorLayout * layout () const override
 The structured affine layout (shape/strides/offset, in elements) backing this pattern, or nullptr when the pattern carries no explicit layout (a flat convex span or no access).
void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
void replace (const symbolic::ExpressionMapping &replacements) override
MemoryAccessPatternType clone () const override
void serialize_to_json (nlohmann::json &entry) override
Public Member Functions inherited from sdfg::data_flow::MemoryAccessPattern
virtual ~MemoryAccessPattern ()=default
MemoryAccessPatternType ref () const

Static Public Member Functions

static MemoryAccessPatternType create (math::tensor::TensorLayout layout, bool not_sparse=false)

Detailed Description

A structured access described by a full affine tensor layout (shape, strides and offset in elements).

Unlike ConvexAccessPattern, which only bounds a flat convex span, this preserves the operand's real multi-dimensional shape so a consumer can reconstruct exactly which elements are touched (e.g. a padded GEMM/MatMul operand).

Constructor & Destructor Documentation

◆ TensorLayoutPattern()

sdfg::data_flow::TensorLayoutPattern::TensorLayoutPattern ( math::tensor::TensorLayout layout,
bool not_sparse = false )
inline

Member Function Documentation

◆ clone()

MemoryAccessPatternType sdfg::data_flow::TensorLayoutPattern::clone ( ) const
overridevirtual

◆ create()

MemoryAccessPatternType sdfg::data_flow::TensorLayoutPattern::create ( math::tensor::TensorLayout layout,
bool not_sparse = false )
static

◆ empty()

bool sdfg::data_flow::TensorLayoutPattern::empty ( ) const
inlineoverridevirtual

There are no elements in this pattern = no accesses of this type.

Implements sdfg::data_flow::MemoryAccessPattern.

◆ every_element_accessed()

bool sdfg::data_flow::TensorLayoutPattern::every_element_accessed ( ) const
inlineoverridevirtual

Every element that is part of this pattern is actually accessed.

If false, this is just an approximation that may contain elements in between the bounds that are not guaranteed to be accessed Ex. indicating write of a[0] and a[9] as ConvexPattern(10) is approximate. Writes a[0], a[1], .. [9] would be every element being accessed. Bounds should never be violated regardless. We may in the future

Implements sdfg::data_flow::MemoryAccessPattern.

◆ layout()

const math::tensor::TensorLayout * sdfg::data_flow::TensorLayoutPattern::layout ( ) const
inlineoverridevirtual

The structured affine layout (shape/strides/offset, in elements) backing this pattern, or nullptr when the pattern carries no explicit layout (a flat convex span or no access).

Only TensorLayoutPattern provides one.

Reimplemented from sdfg::data_flow::MemoryAccessPattern.

◆ replace() [1/2]

void sdfg::data_flow::TensorLayoutPattern::replace ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
inlineoverridevirtual

◆ replace() [2/2]

void sdfg::data_flow::TensorLayoutPattern::replace ( const symbolic::ExpressionMapping & replacements)
inlineoverridevirtual

◆ serialize_to_json()

void sdfg::data_flow::TensorLayoutPattern::serialize_to_json ( nlohmann::json & entry)
overridevirtual

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