docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
external_offloading_node.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <nlohmann/json_fwd.hpp>
5#include <string>
6#include <vector>
7
12#include "sdfg/codegen/utils.h"
15#include "sdfg/element.h"
16#include "sdfg/function.h"
17#include "sdfg/graph/graph.h"
21
22namespace sdfg {
23namespace offloading {
24
26
28private:
29 std::string callee_name_;
30 size_t transfer_index_;
31
32public:
34 size_t element_id,
35 const DebugInfo& debug_info,
38 const std::vector<std::string>& inputs,
39 const std::string& callee_name,
40 size_t transfer_index,
43 );
44
45 const std::string& callee_name() const;
46
47 size_t transfer_index() const;
48
49 std::unique_ptr<data_flow::DataFlowNode>
50 clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const override;
51
52 void validate(const Function& function) const override;
53
54 virtual bool blocking() const override;
55
56 virtual bool redundant_with(const offloading::DataOffloadingNode& other) const override;
57
58 virtual bool equal_with(const offloading::DataOffloadingNode& other) const override;
59
60 virtual bool is_same_target(const offloading::DataOffloadingNode& other) const override;
61};
62
64public:
66 codegen::LanguageExtension& language_extension,
67 const Function& function,
68 const data_flow::DataFlowGraph& data_flow_graph,
69 const data_flow::LibraryNode& node
70 );
71
74 codegen::PrettyPrinter& globals_stream,
75 codegen::CodeSnippetFactory& library_snippet_factory
76 ) override;
77};
78
80public:
81 nlohmann::json serialize(const data_flow::LibraryNode& library_node) override;
82
85 ) override;
86};
87
88} // namespace offloading
89} // 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 > & inputs() const
Get input connector names (const).
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
Name does not match current function.
Definition data_offloading_node.h:49
DataTransferDirection transfer_direction() const
BufferLifecycle buffer_lifecycle() const
void dispatch_code(codegen::PrettyPrinter &stream, codegen::PrettyPrinter &globals_stream, codegen::CodeSnippetFactory &library_snippet_factory) override
Generate the operation-specific code.
ExternalDataOffloadingNodeDispatcher(codegen::LanguageExtension &language_extension, const Function &function, const data_flow::DataFlowGraph &data_flow_graph, const data_flow::LibraryNode &node)
Definition external_offloading_node.h:79
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.
virtual bool redundant_with(const offloading::DataOffloadingNode &other) const override
The 2 nodes are opposites of each other that could cancel each other out.
std::unique_ptr< data_flow::DataFlowNode > clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph &parent) const override
Clone this node for graph transformations.
virtual bool blocking() const override
ExternalDataOffloadingNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const std::vector< std::string > &inputs, const std::string &callee_name, size_t transfer_index, DataTransferDirection transfer_direction, BufferLifecycle buffer_lifecycle)
virtual bool is_same_target(const offloading::DataOffloadingNode &other) const override
const std::string & callee_name() const
virtual bool equal_with(const offloading::DataOffloadingNode &other) const override
The 2 nodes do the same thing.
void validate(const Function &function) const override
Validate the code node's configuration.
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
Library node definitions for calling functions beyond simple instructions.
Definition function_builder.h:10
StringEnum LibraryNodeCode
Definition library_node.h:65
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
Definition data_offloading_node.h:15
DataTransferDirection
Definition data_offloading_node.h:17
data_flow::LibraryNodeCode LibraryNodeType_External_Offloading("ExternalOffloading")
BufferLifecycle
Definition data_offloading_node.h:31
Definition analysis.h:7