docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
cuda_data_offloading_node.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4
9#include "sdfg/element.h"
10#include "sdfg/function.h"
11#include "sdfg/graph/graph.h"
15
16namespace sdfg {
17namespace cuda {
18
20
22private:
23 symbolic::Expression device_id_;
24
25public:
27 size_t element_id,
28 const DebugInfo& debug_info,
35 );
36
37 void validate(const Function& function) const override;
38
40
41 std::unique_ptr<data_flow::DataFlowNode>
42 clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const override;
43
44 symbolic::SymbolSet symbols() const override;
45
46 void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override;
47
48 virtual bool blocking() const override;
49
50 virtual bool redundant_with(const offloading::DataOffloadingNode& other) const override;
51
52 virtual bool equal_with(const offloading::DataOffloadingNode& other) const override;
53
54 virtual bool is_same_target(const DataOffloadingNode& other) const override;
55};
56
58public:
60 codegen::LanguageExtension& language_extension,
61 const Function& function,
62 const data_flow::DataFlowGraph& data_flow_graph,
63 const data_flow::LibraryNode& node
64 );
65
68 std::vector<codegen::DispatchInput>& inputs,
69 std::vector<codegen::DispatchOutput>& outputs
70 ) override;
71
73};
74
85
86} // namespace cuda
87} // 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 instrumentation_info.h:37
Definition language_extension.h:39
Base class for library node code generation dispatchers.
Definition block_dispatcher.h:163
void dispatch_code_with_edges(codegen::CodegenOutput &out, std::vector< codegen::DispatchInput > &inputs, std::vector< codegen::DispatchOutput > &outputs) override
CUDADataOffloadingNodeDispatcher(codegen::LanguageExtension &language_extension, const Function &function, const data_flow::DataFlowGraph &data_flow_graph, const data_flow::LibraryNode &node)
virtual codegen::InstrumentationInfo instrumentation_info() const override
Get instrumentation information for this node.
Definition cuda_data_offloading_node.h:75
nlohmann::json serialize(const sdfg::data_flow::LibraryNode &library_node) override
Serialize a library node to JSON.
data_flow::LibraryNode & deserialize(const nlohmann::json &j, sdfg::builder::StructuredSDFGBuilder &builder, sdfg::structured_control_flow::Block &parent) override
Deserialize a library node from JSON.
void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
virtual bool blocking() const override
virtual bool is_same_target(const DataOffloadingNode &other) const override
virtual bool equal_with(const offloading::DataOffloadingNode &other) const override
The 2 nodes do the same thing.
symbolic::SymbolSet symbols() const override
Get all symbols used in this node.
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.
void validate(const Function &function) const override
Validate the code node's configuration.
const symbolic::Expression device_id() const
virtual bool redundant_with(const offloading::DataOffloadingNode &other) const override
The 2 nodes are opposites of each other that could cancel each other out.
CUDADataOffloadingNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, offloading::DataTransferDirection transfer_direction, offloading::BufferLifecycle buffer_lifecycle, symbolic::Expression size, symbolic::Expression device_id)
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
Definition data_offloading_node.h:246
Name does not match current function.
Definition data_offloading_node.h:49
const symbolic::Expression size() const
DataOffloadingNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const data_flow::LibraryNodeCode code, DataTransferDirection transfer_direction, BufferLifecycle buffer_lifecycle, symbolic::Expression size)
DataTransferDirection transfer_direction() const
BufferLifecycle buffer_lifecycle() const
A control flow node representing a basic block with dataflow computations.
Definition block.h:42
Base class for all nodes in the dataflow graph.
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
Library node definitions for calling functions beyond simple instructions.
Definition function_builder.h:10
Definition cuda_library_node_rewriter_pass.h:11
data_flow::LibraryNodeCode LibraryNodeType_CUDA_Offloading("CUDAOffloading")
StringEnum LibraryNodeCode
Definition library_node.h:65
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
DataTransferDirection
Definition data_offloading_node.h:17
BufferLifecycle
Definition data_offloading_node.h:31
Definition analysis.h:7
Definition block_dispatcher.h:108
Symbolic system for integer-based symbol analysis.