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

Abstract base class for all dataflow graph nodes. More...

#include <sdfg/data_flow/data_flow_node.h>

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

Public Member Functions

 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 validate (const Function &function) const =0
 Validates the element.
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 DataFlowNode.

Static Public Attributes

static constexpr ElementType TypeGroup
 Bitmask of all concrete ElementTypes that are DataFlowNodes.

Protected Member Functions

 DataFlowNode (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent)
 Protected constructor for dataflow nodes.

Friends

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

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

Abstract base class for all dataflow graph nodes.

DataFlowNode provides the core interface for all nodes in the dataflow graph. Key responsibilities:

  • Vertex management: Each node has a unique graph vertex
  • Parent graph access: Nodes know their containing graph
  • Validation: Abstract interface for semantic validation
  • Cloning: Abstract interface for creating node copies

This is an abstract class and cannot be instantiated directly. Use derived classes like AccessNode, Tasklet, or LibraryNode.

Constructor & Destructor Documentation

◆ DataFlowNode() [1/2]

sdfg::data_flow::DataFlowNode::DataFlowNode ( size_t element_id,
const DebugInfo & debug_info,
const graph::Vertex vertex,
DataFlowGraph & parent )
protected

Protected constructor for dataflow nodes.

Parameters
element_idUnique element identifier
debug_infoDebug information for this node
vertexGraph vertex for this node
parentParent dataflow graph

◆ DataFlowNode() [2/2]

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

Member Function Documentation

◆ can_remove_in_edge()

virtual EdgeRemoveOption sdfg::data_flow::DataFlowNode::can_remove_in_edge ( const data_flow::DataFlowGraph & graph,
const Memlet * memlet ) const
pure virtual

◆ can_remove_out_edge()

virtual EdgeRemoveOption sdfg::data_flow::DataFlowNode::can_remove_out_edge ( const data_flow::DataFlowGraph & graph,
const Memlet * memlet ) const
pure virtual

Is the edge in question removable, or will this make the node its an output on invalid?

Currently, some nodes may require every out connector to have at least 1 connection attached

Returns
NotRemovable, NoDependencies, CustomRemove

[NotRemovable] means only if the entire node can be removed, can the edge be removed [NoDependencies] means, the edge can be removed trivially, the node will work without for the remaining functions [CustomRemove] means, a call to [remove_out_edge] can have the node remove the edge itself and make necessary

Implemented in sdfg::data_flow::AccessNode, sdfg::data_flow::LibraryNode, sdfg::data_flow::Tasklet, sdfg::math::cmath::CMathNode, and sdfg::offloading::DataOffloadingNode.

◆ classof()

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

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

◆ clone()

virtual std::unique_ptr< DataFlowNode > sdfg::data_flow::DataFlowNode::clone ( size_t element_id,
const graph::Vertex vertex,
DataFlowGraph & parent ) const
pure virtual

Clone this node for graph transformations.

Parameters
element_idNew element identifier for the clone
vertexNew graph vertex for the clone
parentParent graph for the clone
Returns
Unique pointer to the cloned node

Pure virtual function that must be implemented by derived classes to support graph transformations and optimizations.

Implemented in sdfg::cuda::CUDADataOffloadingNode, sdfg::data_flow::AccessNode, sdfg::data_flow::AtomicScalarOpNode, sdfg::data_flow::BarrierLocalNode, sdfg::data_flow::CallNode, sdfg::data_flow::ConstantNode, sdfg::data_flow::InvokeNode, sdfg::data_flow::LoadConstNode, 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::BatchedGEMMNode, sdfg::math::blas::DotNode, sdfg::math::blas::GEMMNode, sdfg::math::cmath::CMathNode, sdfg::math::tensor::AbsNode, sdfg::math::tensor::AddNode, sdfg::math::tensor::ArangeNode, sdfg::math::tensor::BatchNormNode, sdfg::math::tensor::BroadcastNode, sdfg::math::tensor::CastNode, sdfg::math::tensor::ClampNode, sdfg::math::tensor::CMathTensorNode, sdfg::math::tensor::ConcatNode, sdfg::math::tensor::ConditionalTensorCopyNode, sdfg::math::tensor::ConstPaddingNode, sdfg::math::tensor::ConvNode, sdfg::math::tensor::DivNode, sdfg::math::tensor::EluNode, sdfg::math::tensor::EmbeddingNode, sdfg::math::tensor::EmbeddingRenormNode, sdfg::math::tensor::ErfNode, sdfg::math::tensor::ExpNode, sdfg::math::tensor::FillNode, sdfg::math::tensor::GELUNode, sdfg::math::tensor::IndexNode, sdfg::math::tensor::LayerNormNode, sdfg::math::tensor::LeakyReLUNode, sdfg::math::tensor::LogicalNotNode, sdfg::math::tensor::MatMulNode, sdfg::math::tensor::MaximumNode, sdfg::math::tensor::MaxNode, sdfg::math::tensor::MeanNode, sdfg::math::tensor::MinimumNode, sdfg::math::tensor::MinNode, sdfg::math::tensor::MulNode, sdfg::math::tensor::PoolingNode, sdfg::math::tensor::PowNode, sdfg::math::tensor::ReLUNode, sdfg::math::tensor::RsqrtNode, sdfg::math::tensor::SigmoidNode, sdfg::math::tensor::SoftmaxNode, sdfg::math::tensor::SqrtNode, sdfg::math::tensor::StdNode, sdfg::math::tensor::SubNode, sdfg::math::tensor::SumNode, sdfg::math::tensor::TanhNode, sdfg::math::tensor::TaskletTensorNode, sdfg::math::tensor::TensorCopyNode, sdfg::math::tensor::UpsampleBilinear2DNode, sdfg::offloading::ExternalDataOffloadingNode, sdfg::rocm::ROCMDataOffloadingNode, sdfg::stdlib::AllocaNode, sdfg::stdlib::AssertNode, sdfg::stdlib::CallocNode, 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.

◆ get_parent() [1/2]

DataFlowGraph & sdfg::data_flow::DataFlowNode::get_parent ( )

Get the parent dataflow graph (mutable).

Returns
Mutable reference to the parent DataFlowGraph

◆ get_parent() [2/2]

const DataFlowGraph & sdfg::data_flow::DataFlowNode::get_parent ( ) const

Get the parent dataflow graph (const).

Returns
Const reference to the parent DataFlowGraph

◆ operator=()

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

◆ side_effect()

virtual bool sdfg::data_flow::DataFlowNode::side_effect ( ) const
nodiscardpure virtual

Check if this node has side effects Side effect on dflow nodes is broad.

It just means it cannot be removed just because there are no more direct consumers in the dataflow But underneath, a accessNode-write is considered as having a side effect for this purpose. Closer inspection of access nodes could show those side effects as being irrelevant if never read and fully owned

Implemented in sdfg::data_flow::AccessNode, sdfg::data_flow::ConstantNode, sdfg::data_flow::LibraryNode, and sdfg::data_flow::Tasklet.

◆ update_edge_removed()

virtual bool sdfg::data_flow::DataFlowNode::update_edge_removed ( const std::string & out_conn)
inlinevirtual
Parameters
out_conna output connector, whose edge was just removed after approval via [can_remove_out_edge] == EdgeRemoveOption::RequiresUpdate
Returns
edge removal is completed, node is valid without edge

Reimplemented in sdfg::offloading::DataOffloadingNode.

◆ vertex()

graph::Vertex sdfg::data_flow::DataFlowNode::vertex ( ) const

Get the graph vertex for this node.

Returns
The Boost graph vertex representing this node

◆ sdfg::builder::SDFGBuilder

friend class sdfg::builder::SDFGBuilder
friend

◆ sdfg::builder::StructuredSDFGBuilder

Member Data Documentation

◆ TypeGroup

ElementType sdfg::data_flow::DataFlowNode::TypeGroup
staticconstexpr
Initial value:
@ AccessNode
Definition element.h:75
@ Tasklet
Definition element.h:77
@ LibraryNode
Definition element.h:78
@ ConstantNode
Definition element.h:76

Bitmask of all concrete ElementTypes that are DataFlowNodes.


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