docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
data_flow_node.h
Go to the documentation of this file.
1
51
52#pragma once
53
54#include <boost/lexical_cast.hpp>
55#include <nlohmann/json.hpp>
56
57#include "sdfg/element.h"
58#include "sdfg/graph/graph.h"
59
60using json = nlohmann::json;
61
62namespace sdfg {
63
64namespace builder {
65class SDFGBuilder;
67} // namespace builder
68
69namespace data_flow {
70
88
89class DataFlowGraph;
90class Memlet;
91
106class DataFlowNode : public Element {
109
110private:
111 // Remark: Exclusive resource
112 graph::Vertex vertex_;
113
114 DataFlowGraph* parent_;
115
116protected:
125
126public:
130
132 static bool classof(const Element& element) {
133 return is_a(element.type_id(), TypeGroup);
134 }
135
136 // Remark: Exclusive resource
137 DataFlowNode(const DataFlowNode& data_node) = delete;
139
147 [[nodiscard]] virtual bool side_effect() const = 0;
148
154
159 const DataFlowGraph& get_parent() const;
160
166
177 virtual std::unique_ptr<DataFlowNode>
178 clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph& parent) const = 0;
179
190
192
199 virtual bool update_edge_removed(const std::string& out_conn) {
200 return false;
201 }
202};
203} // namespace data_flow
204} // namespace sdfg
Definition element.h:30
Element(size_t element_id, const DebugInfo &debug_info)
size_t element_id() const
const DebugInfo & debug_info() const
virtual ElementType type_id() const =0
Returns the type of the element.
Definition sdfg_builder.h:13
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Definition data_flow_graph.h:29
virtual EdgeRemoveOption can_remove_in_edge(const data_flow::DataFlowGraph &graph, const Memlet *memlet) const =0
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?
graph::Vertex vertex() const
Get the graph vertex for this node.
static bool classof(const Element &element)
LLVM-style RTTI predicate: true if element is a DataFlowNode.
Definition data_flow_node.h:132
DataFlowGraph & get_parent()
Get the parent dataflow graph (mutable).
DataFlowNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent)
Protected constructor for dataflow nodes.
const DataFlowGraph & get_parent() const
Get the parent dataflow graph (const).
virtual bool update_edge_removed(const std::string &out_conn)
Definition data_flow_node.h:199
DataFlowNode & operator=(const DataFlowNode &)=delete
DataFlowNode(const DataFlowNode &data_node)=delete
static constexpr ElementType TypeGroup
Bitmask of all concrete ElementTypes that are DataFlowNodes.
Definition data_flow_node.h:128
virtual bool side_effect() const =0
Check if this node has side effects Side effect on dflow nodes is broad.
Edge in the dataflow graph representing data movement.
Definition memlet.h:131
nlohmann::json json
Definition interstate_edge.h:14
Definition function_builder.h:10
Definition access_node.h:67
EdgeRemoveOption
Definition data_flow_node.h:71
@ NotRemovable
You must not remove this edge unless you can guarantee the entire node will be removed.
Definition data_flow_node.h:73
@ RemoveNodeAfter
This is the only relevant edge of this node.
Definition data_flow_node.h:86
@ RequiresUpdate
It can be removed, but the node requires a call to update itself to match the removed edge.
Definition data_flow_node.h:81
@ Trivially
You may remove the edge without further action.
Definition data_flow_node.h:77
Definition graph.h:22
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
Definition analysis.h:7
constexpr bool is_a(ElementType type, ElementType mask)
Tests whether type is contained in the category mask (efficient, branch-free type check).
Definition element.h:107
ElementType
Definition element.h:72
@ AccessNode
Definition element.h:75
@ Tasklet
Definition element.h:77
@ LibraryNode
Definition element.h:78
@ Memlet
Definition element.h:79
@ ConstantNode
Definition element.h:76