docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
data_flow_node.h File Reference

Base class for all nodes in the dataflow graph. More...

#include <boost/lexical_cast.hpp>
#include <nlohmann/json.hpp>
#include "sdfg/element.h"
#include "sdfg/graph/graph.h"

Go to the source code of this file.

Classes

class  sdfg::data_flow::DataFlowNode
 Abstract base class for all dataflow graph nodes. More...

Namespaces

namespace  sdfg
namespace  sdfg::builder
namespace  sdfg::data_flow

Enumerations

enum class  sdfg::data_flow::EdgeRemoveOption { sdfg::data_flow::NotRemovable , sdfg::data_flow::Trivially , sdfg::data_flow::RequiresUpdate , sdfg::data_flow::RemoveNodeAfter }

Detailed Description

Base class for all nodes in the dataflow graph.

DataFlowNode is the abstract base class for all nodes that can appear in a dataflow graph. It provides the fundamental interface for nodes including vertex management, parent graph access, validation, and cloning.

Key Concepts

Node Hierarchy

The node hierarchy is:

  • DataFlowNode (abstract base)
    • AccessNode: Data access points (variables, arrays)
      • ConstantNode: Constant literal values
    • CodeNode: Computational operations (abstract)
      • Tasklet: Simple operations (add, mul, etc.)
      • LibraryNode: Complex operations (BLAS, etc.)

Graph Vertex

Each node is associated with a Boost graph vertex that represents its position in the dataflow graph. The vertex is used for graph traversal and edge management.

Parent Graph

Each node maintains a reference to its parent DataFlowGraph, which owns the node and manages its lifetime and connections.

Example Usage

Working with nodes through the base interface:

// Get the node's vertex for graph operations
graph::Vertex v = node.vertex();
// Get the parent dataflow graph
DataFlowGraph& graph = node.get_parent();
// Check incoming/outgoing edges
size_t in_degree = graph.in_degree(node);
size_t out_degree = graph.out_degree(node);
// Validate the node
node.validate(function);
See also
AccessNode for data access nodes
CodeNode for computational nodes
DataFlowGraph for the container graph
Element for the base element class