docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
code_node.h
Go to the documentation of this file.
1
57
58#pragma once
59
61#include "sdfg/graph/graph.h"
62#include "sdfg/types/scalar.h"
63
64namespace sdfg {
65
66namespace builder {
67class SDFGBuilder;
69} // namespace builder
70
71namespace data_flow {
72
88class CodeNode : public DataFlowNode {
91
92protected:
93 std::vector<std::string> outputs_;
94 std::vector<std::string> inputs_;
95
106 size_t element_id,
107 const DebugInfo& debug_info,
108 const graph::Vertex vertex,
109 DataFlowGraph& parent,
110 const std::vector<std::string>& outputs,
111 const std::vector<std::string>& inputs
112 );
113
114public:
117
119 static bool classof(const Element& element) {
120 return is_a(element.type_id(), TypeGroup);
121 }
122
123 CodeNode(const CodeNode& data_node) = delete;
124 CodeNode& operator=(const CodeNode&) = delete;
125
133 void validate(const Function& function) const override;
134
139 const std::vector<std::string>& outputs() const;
140
145 const std::vector<std::string>& inputs() const;
146
151 std::vector<std::string>& outputs();
152
157 std::vector<std::string>& inputs();
158
164 const std::string& output(size_t index) const;
165
171 const std::string& input(size_t index) const;
172
178 bool has_constant_input(size_t index) const;
179};
180} // namespace data_flow
181} // 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 function.h:43
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
std::vector< std::string > outputs_
Names of output connectors.
Definition code_node.h:93
bool has_constant_input(size_t index) const
Check if an input is connected to a constant node.
CodeNode & operator=(const CodeNode &)=delete
static bool classof(const Element &element)
LLVM-style RTTI predicate: true if element is a CodeNode.
Definition code_node.h:119
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.
const std::vector< std::string > & outputs() const
Get output connector names (const).
void validate(const Function &function) const override
Validate the code node's configuration.
const std::string & output(size_t index) const
Get output connector name by index.
CodeNode(const CodeNode &data_node)=delete
static constexpr ElementType TypeGroup
Bitmask of all concrete ElementTypes that are CodeNodes.
Definition code_node.h:116
const std::string & input(size_t index) const
Get input connector name by index.
std::vector< std::string > & outputs()
Get output connector names (mutable).
std::vector< std::string > & inputs()
Get input connector names (mutable).
const std::vector< std::string > & inputs() const
Get input connector names (const).
std::vector< std::string > inputs_
Names of input connectors.
Definition code_node.h:94
Definition data_flow_graph.h:29
graph::Vertex vertex() const
Get the graph vertex for this node.
DataFlowNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent)
Protected constructor for dataflow nodes.
Base class for all nodes in the dataflow graph.
Definition function_builder.h:10
Definition access_node.h:67
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
@ Tasklet
Definition element.h:77
@ LibraryNode
Definition element.h:78
Scalar (primitive) type representation.