docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
invoke_node.h
Go to the documentation of this file.
1#pragma once
2
4
7
8namespace sdfg {
9namespace data_flow {
10
12
13class InvokeNode : public LibraryNode {
14protected:
15 std::string callee_name_;
16
17public:
19 size_t element_id,
20 const DebugInfo& debug_info,
22 DataFlowGraph& parent,
23 const std::string& callee_name,
24 const std::vector<std::string>& outputs,
25 const std::vector<std::string>& inputs
26 );
27
28 const std::string& callee_name() const;
29
30 bool is_void(const Function& sdfg) const;
31
32 bool is_indirect_call(const Function& sdfg) const;
33
34 void validate(const Function& function) const override;
35
36 symbolic::SymbolSet symbols() const override;
37
38 void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override;
39
40 void replace(const symbolic::ExpressionMapping& replacements) override;
41
42 std::unique_ptr<DataFlowNode> clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph& parent) const override;
43};
44
46public:
47 nlohmann::json serialize(const LibraryNode& library_node) override;
48
51 ) override;
52};
53
55public:
57 codegen::LanguageExtension& language_extension,
58 const Function& function,
59 const DataFlowGraph& data_flow_graph,
60 const InvokeNode& node
61 );
62
65 codegen::PrettyPrinter& globals_stream,
66 codegen::CodeSnippetFactory& library_snippet_factory
67 ) override;
68};
69
70} // namespace data_flow
71} // namespace sdfg
Dispatchers for dataflow blocks and library nodes.
Definition element.h:30
size_t element_id() const
const DebugInfo & debug_info() const
Definition function.h:43
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
Originally started out as a handler for additional source files, like hardware-accelerator kernels th...
Definition code_snippet_factory.h:69
Definition language_extension.h:39
Base class for library node code generation dispatchers.
Definition block_dispatcher.h:163
Definition utils.h:16
const std::vector< std::string > & outputs() const
Get output connector names (const).
const std::vector< std::string > & inputs() const
Get input connector names (const).
Definition data_flow_graph.h:29
graph::Vertex vertex() const
Get the graph vertex for this node.
InvokeNodeDispatcher(codegen::LanguageExtension &language_extension, const Function &function, const DataFlowGraph &data_flow_graph, const InvokeNode &node)
void dispatch_code(codegen::PrettyPrinter &stream, codegen::PrettyPrinter &globals_stream, codegen::CodeSnippetFactory &library_snippet_factory) override
Generate the operation-specific code.
Definition invoke_node.h:45
LibraryNode & deserialize(const nlohmann::json &j, builder::StructuredSDFGBuilder &builder, structured_control_flow::Block &parent) override
Deserialize a library node from JSON.
nlohmann::json serialize(const LibraryNode &library_node) override
Serialize a library node to JSON.
Definition invoke_node.h:13
symbolic::SymbolSet symbols() const override
Get all symbols used in this node.
void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
void replace(const symbolic::ExpressionMapping &replacements) override
bool is_indirect_call(const Function &sdfg) const
InvokeNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent, const std::string &callee_name, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs)
std::string callee_name_
Definition invoke_node.h:15
bool is_void(const Function &sdfg) const
void validate(const Function &function) const override
Validate the code node's configuration.
std::unique_ptr< DataFlowNode > clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph &parent) const override
Clone this node for graph transformations.
const std::string & callee_name() const
Base class for all library nodes in the dataflow graph.
Definition library_node.h:106
LibraryNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent, const LibraryNodeCode &code, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs, const bool side_effect, const ImplementationType &implementation_type)
Protected constructor for library nodes.
Base class for library node serialization.
Definition json_serializer.h:195
A control flow node representing a basic block with dataflow computations.
Definition block.h:42
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
std::set< Symbol, SymEngine::RCPBasicKeyLess > SymbolSet
Ordered set of symbols.
Definition symbolic.h:95
SymEngine::map_basic_basic ExpressionMapping
Definition symbolic.h:109
Library node definitions for calling functions beyond simple instructions.
Definition function_builder.h:10
Definition access_node.h:67
StringEnum LibraryNodeCode
Definition library_node.h:65
LibraryNodeCode LibraryNodeType_Invoke("Invoke")
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
Definition analysis.h:7