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

A state in a Stateful DataFlow Graph (SDFG). More...

#include <sdfg/control_flow/state.h>

Inheritance diagram for sdfg::control_flow::State:
[legend]

Public Member Functions

 State (const State &state)=delete
State & operator= (const State &)=delete
ElementType type_id () const override
 Returns the type of the element.
void validate (const Function &function) const override
 Validates the state within the context of a function.
graph::Vertex vertex () const
 Returns the graph vertex representing this state.
const data_flow::DataFlowGraph & dataflow () const
 Returns the data-flow graph of this state (const version).
data_flow::DataFlowGraph & dataflow ()
 Returns the data-flow graph of this state (mutable version).
void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
 Replaces symbolic expressions in the state's data-flow graph.
Public Member Functions inherited from sdfg::Element
 Element (size_t element_id, const DebugInfo &debug_info)
virtual ~Element ()=default
size_t element_id () const
const DebugInfo & debug_info () const
void set_debug_info (const DebugInfo &debug_info)
void add_metadata (const std::string &key, const std::string &value)
void remove_metadata (const std::string &key)
const std::string & metadata (const std::string &key) const
const std::string * metadata_if_exists (const std::string &key) const
const std::unordered_map< std::string, std::string > & metadata () const
std::string_view element_type () const
 Returns the type of the element as a human-readable string.
virtual void replace (const symbolic::ExpressionMapping &replacements)

Static Public Member Functions

static bool classof (const Element &element)

Protected Member Functions

 State (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex)

Friends

class sdfg::builder::SDFGBuilder

Additional Inherited Members

Protected Attributes inherited from sdfg::Element
size_t element_id_
DebugInfo debug_info_
std::unordered_map< std::string, std::string > metadata_

Detailed Description

A state in a Stateful DataFlow Graph (SDFG).

States are the fundamental building blocks of an SDFG control-flow graph. Each state represents a computational stage and contains a data-flow graph describing the computations performed when the state is executed.

SDFGs can be constructed in two ways:

  1. Control-Flow Approach: Using State nodes connected by InterstateEdge edges (this is the approach using this class). This creates a general directed graph that can contain cycles.
  2. Structured Control-Flow Approach: Using structured_control_flow elements (e.g., For, While, IfElse) which yield an acyclic StructuredSDFG.
See also
InterstateEdge for transitions between states
data_flow::DataFlowGraph for the computational graph within a state

Constructor & Destructor Documentation

◆ State() [1/2]

sdfg::control_flow::State::State ( size_t element_id,
const DebugInfo & debug_info,
const graph::Vertex vertex )
protected

◆ State() [2/2]

sdfg::control_flow::State::State ( const State & state)
delete

Member Function Documentation

◆ classof()

bool sdfg::control_flow::State::classof ( const Element & element)
inlinestatic

◆ dataflow() [1/2]

data_flow::DataFlowGraph & sdfg::control_flow::State::dataflow ( )

Returns the data-flow graph of this state (mutable version).

Returns
Mutable reference to the data-flow graph containing computational nodes

◆ dataflow() [2/2]

const data_flow::DataFlowGraph & sdfg::control_flow::State::dataflow ( ) const

Returns the data-flow graph of this state (const version).

Returns
Const reference to the data-flow graph containing computational nodes

◆ operator=()

State & sdfg::control_flow::State::operator= ( const State & )
delete

◆ replace()

void sdfg::control_flow::State::replace ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
overridevirtual

Replaces symbolic expressions in the state's data-flow graph.

Parameters
old_expressionThe expression to replace
new_expressionThe replacement expression

Implements sdfg::Element.

◆ type_id()

ElementType sdfg::control_flow::State::type_id ( ) const
inlineoverridevirtual

Returns the type of the element.

Implements sdfg::Element.

◆ validate()

void sdfg::control_flow::State::validate ( const Function & function) const
overridevirtual

Validates the state within the context of a function.

Parameters
functionThe function containing this state
Exceptions
InvalidSDFGExceptionif validation fails

Implements sdfg::Element.

◆ vertex()

graph::Vertex sdfg::control_flow::State::vertex ( ) const

Returns the graph vertex representing this state.

Returns
The graph vertex associated with this state

◆ sdfg::builder::SDFGBuilder

friend class sdfg::builder::SDFGBuilder
friend

The documentation for this class was generated from the following file:
  • sdfg/include/sdfg/control_flow/state.h