docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
free.h
Go to the documentation of this file.
1#pragma once
2
5
8
9namespace sdfg {
10namespace stdlib {
11
13
14class FreeNode : public StdlibNode {
15public:
17
18 void validate(const Function& function) const override;
19
20 symbolic::SymbolSet symbols() const override;
21
22 std::unique_ptr<DataFlowNode>
23 clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const override;
24
25 void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override;
26
27 void replace(const symbolic::ExpressionMapping& replacements) override;
28
30};
31
33public:
34 nlohmann::json serialize(const data_flow::LibraryNode& library_node) override;
35
38 ) override;
39};
40
42public:
44 codegen::LanguageExtension& language_extension,
45 const Function& function,
46 const data_flow::DataFlowGraph& data_flow_graph,
47 const FreeNode& node
48 );
49
52 std::vector<codegen::DispatchInput>& inputs,
53 std::vector<codegen::DispatchOutput>& outputs
54 ) override;
55};
56
59 Block& block,
60 const std::string& ptr,
61 const types::IType& ptr_type,
62 DebugInfo debug_info = DebugInfo()
63);
64
65std::tuple<Block&, FreeNode&> add_free_block(
67 Sequence& parent,
68 const std::string& ptr,
69 const types::IType& ptr_type,
70 DebugInfo debug_info = DebugInfo()
71);
72
73} // namespace stdlib
74} // 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
Definition language_extension.h:39
Base class for library node code generation dispatchers.
Definition block_dispatcher.h:163
Definition data_flow_graph.h:29
graph::Vertex vertex() const
Get the graph vertex for this node.
Base class for all library nodes in the dataflow graph.
Definition library_node.h:106
Base class for library node serialization.
Definition json_serializer.h:195
void dispatch_code_with_edges(codegen::CodegenOutput &out, std::vector< codegen::DispatchInput > &inputs, std::vector< codegen::DispatchOutput > &outputs) override
FreeNodeDispatcher(codegen::LanguageExtension &language_extension, const Function &function, const data_flow::DataFlowGraph &data_flow_graph, const FreeNode &node)
nlohmann::json serialize(const data_flow::LibraryNode &library_node) override
Serialize a library node to JSON.
data_flow::LibraryNode & deserialize(const nlohmann::json &j, builder::StructuredSDFGBuilder &builder, structured_control_flow::Block &parent) override
Deserialize a library node from JSON.
Definition free.h:14
FreeNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent)
void validate(const Function &function) const override
Validate the code node's configuration.
symbolic::SymbolSet symbols() const override
Get all symbols used in this node.
void replace(const symbolic::ExpressionMapping &replacements) override
data_flow::PointerAccessType pointer_access_type(int input_idx) const override
Describes what a pointer is used for.
void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
std::unique_ptr< DataFlowNode > clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph &parent) const override
Clone this node for graph transformations.
StdlibNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const data_flow::LibraryNodeCode &code, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs, const bool side_effect, const data_flow::ImplementationType &implementation_type)
Protected constructor for library nodes.
A control flow node representing a basic block with dataflow computations.
Definition block.h:42
A sequential container of control flow nodes.
Definition sequence.h:52
Abstract base interface for all types in the sdfglib type system.
Definition type.h:625
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
StringEnum LibraryNodeCode
Definition library_node.h:65
std::unique_ptr< PointerAccessMeta, PtrAccessDeleter > PointerAccessType
Definition pointer_metadata.h:32
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
Definition alloca.h:10
FreeNode & add_free_node(builder::StructuredSDFGBuilder &builder, Block &block, const std::string &ptr, const types::IType &ptr_type, DebugInfo debug_info=DebugInfo())
data_flow::LibraryNodeCode LibraryNodeType_Free("Free")
std::tuple< Block &, FreeNode & > add_free_block(builder::StructuredSDFGBuilder &builder, Sequence &parent, const std::string &ptr, const types::IType &ptr_type, DebugInfo debug_info=DebugInfo())
Definition analysis.h:7
Definition block_dispatcher.h:108