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

A control flow node representing a basic block with dataflow computations. More...

#include <sdfg/structured_control_flow/block.h>

Inheritance diagram for sdfg::structured_control_flow::Block:
[legend]

Public Member Functions

 Block (const Block &block)=delete
Block & operator= (const Block &)=delete
ElementType type_id () const override
 Returns the type of the element.
bool accept (visitor::ActualStructuredSDFGVisitor &visitor) override
void validate (const Function &function) const override
 Validates the element.
const data_flow::DataFlowGraph & dataflow () const
 Access the dataflow graph (const version).
data_flow::DataFlowGraph & dataflow ()
 Access the dataflow graph (non-const version).
void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
 Replace occurrences of an expression in the dataflow graph.
void replace (const symbolic::ExpressionMapping &replacements) override
template<typename T>
T * is_a_library_node ()
Public Member Functions inherited from sdfg::structured_control_flow::ControlFlowNode
virtual ~ControlFlowNode ()=default
ControlFlowNode * get_parent ()
const ControlFlowNode * get_parent () const
 ControlFlowNode (const ControlFlowNode &node)=delete
ControlFlowNode & operator= (const ControlFlowNode &)=delete
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.

Static Public Member Functions

static bool classof (const Element &element)
Static Public Member Functions inherited from sdfg::structured_control_flow::ControlFlowNode
static bool classof (const Element &element)
 LLVM-style RTTI predicate: true if element is a ControlFlowNode.
static std::vector< ControlFlowNode * > parent_chain (ControlFlowNode &child)

Friends

class sdfg::builder::StructuredSDFGBuilder

Additional Inherited Members

Static Public Attributes inherited from sdfg::structured_control_flow::ControlFlowNode
static constexpr ElementType TypeGroup
 Bitmask of all concrete ElementTypes that are ControlFlowNodes.
Protected Member Functions inherited from sdfg::structured_control_flow::ControlFlowNode
 ControlFlowNode (size_t element_id, const DebugInfo &debug_info, ControlFlowNode *parent)
 Protected constructor for control flow nodes with parent.
Protected Attributes inherited from sdfg::structured_control_flow::ControlFlowNode
ControlFlowNode * parent_
Protected Attributes inherited from sdfg::Element
size_t element_id_
DebugInfo debug_info_
std::unordered_map< std::string, std::string > metadata_

Detailed Description

A control flow node representing a basic block with dataflow computations.

A Block is the fundamental computation unit in a StructuredSDFG. It represents a basic block that contains a dataflow graph describing the computations to be performed. The dataflow graph consists of nodes (tasklets, access nodes, library nodes) and memlets (data movement edges).

Blocks are analogous to States in the unstructured SDFG model, but they exist within the structured control flow hierarchy. Each Block contains:

  • A DataFlowGraph describing the computations and data movements
  • Implicit sequential ordering with respect to other control flow nodes

Blocks can contain:

  • Tasklets: Small code snippets performing computations
  • Access nodes: Read/write access to containers (arrays, scalars)
  • Library nodes: Calls to library functions (BLAS, tensor operations, etc.)
  • Memlets: Edges describing data movement between nodes
See also
data_flow::DataFlowGraph
data_flow::Tasklet
control_flow::State

Constructor & Destructor Documentation

◆ Block()

sdfg::structured_control_flow::Block::Block ( const Block & block)
delete

Member Function Documentation

◆ accept()

bool sdfg::structured_control_flow::Block::accept ( visitor::ActualStructuredSDFGVisitor & visitor)
overridevirtual

◆ classof()

bool sdfg::structured_control_flow::Block::classof ( const Element & element)
inlinestatic

◆ dataflow() [1/2]

data_flow::DataFlowGraph & sdfg::structured_control_flow::Block::dataflow ( )

Access the dataflow graph (non-const version).

Returns
Reference to the dataflow graph for modification

◆ dataflow() [2/2]

const data_flow::DataFlowGraph & sdfg::structured_control_flow::Block::dataflow ( ) const

Access the dataflow graph (const version).

Returns
Const reference to the dataflow graph

◆ is_a_library_node()

template<typename T>
T * sdfg::structured_control_flow::Block::is_a_library_node ( )
inline

◆ operator=()

Block & sdfg::structured_control_flow::Block::operator= ( const Block & )
delete

◆ replace() [1/2]

void sdfg::structured_control_flow::Block::replace ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
overridevirtual

Replace occurrences of an expression in the dataflow graph.

Parameters
old_expressionExpression to replace
new_expressionExpression to replace with

Implements sdfg::Element.

◆ replace() [2/2]

void sdfg::structured_control_flow::Block::replace ( const symbolic::ExpressionMapping & replacements)
overridevirtual

Reimplemented from sdfg::Element.

◆ type_id()

ElementType sdfg::structured_control_flow::Block::type_id ( ) const
inlineoverridevirtual

Returns the type of the element.

Implements sdfg::Element.

◆ validate()

void sdfg::structured_control_flow::Block::validate ( const Function & function) const
overridevirtual

Validates the element.

Exceptions
InvalidSDFGExceptionif the element is invalid

Implements sdfg::Element.

◆ sdfg::builder::StructuredSDFGBuilder


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