docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
tasklet_node.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <memory>
5#include <nlohmann/json_fwd.hpp>
6#include <string>
7#include <vector>
8
17#include "sdfg/element.h"
18#include "sdfg/function.h"
19#include "sdfg/graph/graph.h"
23
24namespace sdfg {
25namespace math {
26namespace tensor {
27
29
31private:
32 data_flow::TaskletCode tasklet_code_;
33
34public:
36 size_t element_id,
37 const DebugInfo& debug_info,
41 const std::string& modified_tensor_conn,
42 const std::vector<std::string>& tensor_inputs,
43 const std::vector<symbolic::Expression>& shape,
46 );
47
48 void validate(const Function& function) const override;
49
55
56 bool supports_integer_types() const override;
57
60 Block& block,
61 std::vector<ElementInput>& needed_inputs,
62 types::PrimitiveType expected_type
63 ) override;
64
65 std::unique_ptr<data_flow::DataFlowNode>
66 clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const override;
67
68 std::string toStr() const override;
69};
70
72public:
73 nlohmann::json serialize(const data_flow::LibraryNode& library_node) override;
74
77 ) override;
78};
79
80} // namespace tensor
81} // namespace math
82} // namespace sdfg
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 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
ElementWiseDataflowTensorNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const data_flow::LibraryNodeCode &code, const std::vector< symbolic::Expression > &shape, const std::string &modified_tensor_conn, const std::vector< std::string > &tensor_inputs, QuantizationType quantization=QUANTIZATION_MATCH_INPUTS, const data_flow::ImplementationType &impl_type=data_flow::ImplementationType_NONE)
QuantizationType quantization() const
Definition elementwise_node.h:136
const std::vector< symbolic::Expression > & shape() const
Get the tensor shape.
Definition elementwise_node.h:174
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.
ElementOutput expand_operation_dataflow(builder::StructuredSDFGBuilder &builder, Block &block, std::vector< ElementInput > &needed_inputs, types::PrimitiveType expected_type) override
Models the pure dataflow of the operation as applied to each element of the output as a function of t...
TaskletTensorNode(size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const data_flow::TaskletCode tasklet_code, const std::string &modified_tensor_conn, const std::vector< std::string > &tensor_inputs, const std::vector< symbolic::Expression > &shape, QuantizationType quantization=QUANTIZATION_MATCH_INPUTS, const data_flow::ImplementationType &impl_type=data_flow::ImplementationType_NONE)
bool supports_integer_types() const override
Check if this operation supports integer types.
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.
data_flow::TaskletCode tasklet_code() const
Get the operation code.
std::string toStr() const override
Convert node to string representation.
void validate(const Function &function) const override
Validate the code node's configuration.
A control flow node representing a basic block with dataflow computations.
Definition block.h:42
Base class for all nodes in the dataflow graph.
Tensor elementwise operation nodes.
Library node definitions for calling functions beyond simple instructions.
Definition function_builder.h:10
StringEnum ImplementationType
Implementation type identifier for library nodes.
Definition library_node.h:75
StringEnum LibraryNodeCode
Definition library_node.h:65
TaskletCode
Operation codes for tasklet computations.
Definition tasklet.h:94
ImplementationType ImplementationType_NONE
Default implementation type indicating no specific implementation.
Definition library_node.h:84
boost::graph_traits< Graph >::vertex_descriptor Vertex
Definition graph.h:25
Definition arange_node.h:8
constexpr QuantizationType QUANTIZATION_MATCH_INPUTS
Definition tensor_node.h:27
data_flow::LibraryNodeCode LibraryNodeType_TensorTasklet("ml::Tasklet")
types::PrimitiveType QuantizationType
Definition tensor_node.h:26
Definition batched_gemm_node.h:12
PrimitiveType
Enumeration of all primitive data types supported by sdfglib.
Definition type.h:35
Definition analysis.h:7
Symbolic system for integer-based symbol analysis.
Simple computational operations in the dataflow graph.
Abstract base class for tensor library nodes.