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

Base class for computational nodes with inputs and outputs. More...

#include <sdfg/data_flow/code_node.h>

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

Public Member Functions

 CodeNode (const CodeNode &data_node)=delete
CodeNode & operator= (const CodeNode &)=delete
void validate (const Function &function) const override
 Validate the code node's configuration.
const std::vector< std::string > & outputs () const
 Get output connector names (const).
const std::vector< std::string > & inputs () const
 Get input connector names (const).
std::vector< std::string > & outputs ()
 Get output connector names (mutable).
std::vector< std::string > & inputs ()
 Get input connector names (mutable).
const std::string & output (size_t index) const
 Get output connector name by index.
const std::string & input (size_t index) const
 Get input connector name by index.
bool has_constant_input (size_t index) const
 Check if an input is connected to a constant node.
Public Member Functions inherited from sdfg::data_flow::DataFlowNode
 DataFlowNode (const DataFlowNode &data_node)=delete
DataFlowNode & operator= (const DataFlowNode &)=delete
virtual bool side_effect () const =0
 Check if this node has side effects Side effect on dflow nodes is broad.
graph::Vertex vertex () const
 Get the graph vertex for this node.
const DataFlowGraph & get_parent () const
 Get the parent dataflow graph (const).
DataFlowGraph & get_parent ()
 Get the parent dataflow graph (mutable).
virtual std::unique_ptr< DataFlowNode > clone (size_t element_id, const graph::Vertex vertex, DataFlowGraph &parent) const =0
 Clone this node for graph transformations.
virtual EdgeRemoveOption can_remove_out_edge (const data_flow::DataFlowGraph &graph, const Memlet *memlet) const =0
 Is the edge in question removable, or will this make the node its an output on invalid?
virtual EdgeRemoveOption can_remove_in_edge (const data_flow::DataFlowGraph &graph, const Memlet *memlet) const =0
virtual bool update_edge_removed (const std::string &out_conn)
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
virtual ElementType type_id () const =0
 Returns the type of the element.
std::string_view element_type () const
 Returns the type of the element as a human-readable string.
virtual void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression)=0
virtual void replace (const symbolic::ExpressionMapping &replacements)

Static Public Member Functions

static bool classof (const Element &element)
 LLVM-style RTTI predicate: true if element is a CodeNode.
Static Public Member Functions inherited from sdfg::data_flow::DataFlowNode
static bool classof (const Element &element)
 LLVM-style RTTI predicate: true if element is a DataFlowNode.

Static Public Attributes

static constexpr ElementType TypeGroup = ElementType::Tasklet | ElementType::LibraryNode
 Bitmask of all concrete ElementTypes that are CodeNodes.
Static Public Attributes inherited from sdfg::data_flow::DataFlowNode
static constexpr ElementType TypeGroup
 Bitmask of all concrete ElementTypes that are DataFlowNodes.

Protected Member Functions

 CodeNode (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs)
 Protected constructor for code nodes.
Protected Member Functions inherited from sdfg::data_flow::DataFlowNode
 DataFlowNode (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent)
 Protected constructor for dataflow nodes.

Protected Attributes

std::vector< std::string > outputs_
 Names of output connectors.
std::vector< std::string > inputs_
 Names of input connectors.
Protected Attributes inherited from sdfg::Element
size_t element_id_
DebugInfo debug_info_
std::unordered_map< std::string, std::string > metadata_

Friends

class sdfg::builder::SDFGBuilder
class sdfg::builder::StructuredSDFGBuilder

Detailed Description

Base class for computational nodes with inputs and outputs.

CodeNode represents any computational operation in the dataflow graph. It provides:

  • Named input and output connectors
  • Methods to query and modify connectors
  • Detection of constant inputs
  • Abstract cloning interface for graph transformations

Derived classes must implement:

Constructor & Destructor Documentation

◆ CodeNode() [1/2]

sdfg::data_flow::CodeNode::CodeNode ( size_t element_id,
const DebugInfo & debug_info,
const graph::Vertex vertex,
DataFlowGraph & parent,
const std::vector< std::string > & outputs,
const std::vector< std::string > & inputs )
protected

Protected constructor for code nodes.

Parameters
element_idUnique element identifier
debug_infoDebug information for this node
vertexGraph vertex for this node
parentParent dataflow graph
outputsNames of output connectors
inputsNames of input connectors

◆ CodeNode() [2/2]

sdfg::data_flow::CodeNode::CodeNode ( const CodeNode & data_node)
delete

Member Function Documentation

◆ classof()

bool sdfg::data_flow::CodeNode::classof ( const Element & element)
inlinestatic

LLVM-style RTTI predicate: true if element is a CodeNode.

◆ has_constant_input()

bool sdfg::data_flow::CodeNode::has_constant_input ( size_t index) const

Check if an input is connected to a constant node.

Parameters
indexIndex of the input connector to check
Returns
True if the input is connected to a ConstantNode, false otherwise

◆ input()

const std::string & sdfg::data_flow::CodeNode::input ( size_t index) const

Get input connector name by index.

Parameters
indexIndex of the input connector
Returns
Name of the input connector at the given index

◆ inputs() [1/2]

std::vector< std::string > & sdfg::data_flow::CodeNode::inputs ( )

Get input connector names (mutable).

Returns
Mutable reference to vector of input connector names

◆ inputs() [2/2]

const std::vector< std::string > & sdfg::data_flow::CodeNode::inputs ( ) const

Get input connector names (const).

Returns
Const reference to vector of input connector names

◆ operator=()

CodeNode & sdfg::data_flow::CodeNode::operator= ( const CodeNode & )
delete

◆ output()

const std::string & sdfg::data_flow::CodeNode::output ( size_t index) const

Get output connector name by index.

Parameters
indexIndex of the output connector
Returns
Name of the output connector at the given index

◆ outputs() [1/2]

std::vector< std::string > & sdfg::data_flow::CodeNode::outputs ( )

Get output connector names (mutable).

Returns
Mutable reference to vector of output connector names

◆ outputs() [2/2]

const std::vector< std::string > & sdfg::data_flow::CodeNode::outputs ( ) const

Get output connector names (const).

Returns
Const reference to vector of output connector names

◆ validate()

void sdfg::data_flow::CodeNode::validate ( const Function & function) const
overridevirtual

Validate the code node's configuration.

Parameters
functionFunction context for validation

Ensures that:

  • No two access nodes connect to the same data for inputs/outputs

Implements sdfg::Element.

Reimplemented in sdfg::cuda::CUDADataOffloadingNode, sdfg::data_flow::InvokeNode, sdfg::data_flow::MetadataNode, sdfg::data_flow::Tasklet, sdfg::einsum::EinsumNode, sdfg::fp_math::OzakiMatMulNode, sdfg::gpu::GpuMmaFillNode, sdfg::gpu::GpuMmaFragmentEltwiseAddNode, sdfg::gpu::GpuMmaFragmentLoadNode, sdfg::gpu::GpuMmaFragmentStoreNode, sdfg::gpu::GpuMmaMatmulNode, sdfg::gpu::GpuTileArrivalNode, sdfg::math::blas::DotNode, sdfg::math::blas::GEMMNode, sdfg::math::tensor::ConcatNode, sdfg::math::tensor::ConditionalTensorCopyNode, sdfg::math::tensor::ConstPaddingNode, sdfg::math::tensor::ConvNode, sdfg::math::tensor::ElementWiseDataflowTensorNode, sdfg::math::tensor::EluNode, sdfg::math::tensor::EmbeddingNode, sdfg::math::tensor::EmbeddingRenormNode, sdfg::math::tensor::IndexNode, sdfg::math::tensor::LayerNormNode, sdfg::math::tensor::LeakyReLUNode, sdfg::math::tensor::LogicalNotNode, sdfg::math::tensor::MatMulNode, sdfg::math::tensor::PoolingNode, sdfg::math::tensor::ReduceNode, sdfg::math::tensor::SoftmaxNode, sdfg::math::tensor::TaskletTensorNode, sdfg::math::tensor::TensorCopyNode, sdfg::math::tensor::TensorNode, sdfg::math::tensor::UpsampleBilinear2DNode, sdfg::offloading::ExternalDataOffloadingNode, sdfg::rocm::ROCMDataOffloadingNode, sdfg::stdlib::FreeNode, sdfg::stdlib::MallocNode, sdfg::stdlib::MemcpyNode, sdfg::stdlib::MemmoveNode, sdfg::stdlib::MemsetNode, sdfg::stdlib::TrapNode, sdfg::stdlib::UnreachableNode, sdfg::tiles::PipelineCommitNode, sdfg::tiles::PipelineWaitNode, and sdfg::tiles::TileCopyNode.

◆ sdfg::builder::SDFGBuilder

friend class sdfg::builder::SDFGBuilder
friend

◆ sdfg::builder::StructuredSDFGBuilder

Member Data Documentation

◆ inputs_

std::vector<std::string> sdfg::data_flow::CodeNode::inputs_
protected

Names of input connectors.

◆ outputs_

std::vector<std::string> sdfg::data_flow::CodeNode::outputs_
protected

Names of output connectors.

◆ TypeGroup

ElementType sdfg::data_flow::CodeNode::TypeGroup = ElementType::Tasklet | ElementType::LibraryNode
staticconstexpr

Bitmask of all concrete ElementTypes that are CodeNodes.


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