docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
fuse_fma.h
Go to the documentation of this file.
1#pragma once
2
3#include <nlohmann/json_fwd.hpp>
4#include <string>
5
12
13namespace sdfg {
14namespace fp_math {
15
30private:
32 data_flow::Tasklet* fma_ = nullptr;
33 bool invalidate_analysis_;
34
35 struct Match {
36 data_flow::Tasklet* multiply = nullptr;
37 data_flow::AccessNode* product = nullptr;
38 data_flow::Memlet* product_edge = nullptr;
39 data_flow::Memlet* addend_edge = nullptr;
40 };
41
42 bool match(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager, Match& out);
43
44public:
45 explicit FuseFMA(data_flow::Tasklet& add, bool invalidate_analysis = true);
46
47 virtual std::string name() const override;
48
49 virtual bool
51
52 virtual void apply(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) override;
53
54 virtual void to_json(nlohmann::json& j) const override;
55
56 static FuseFMA from_json(builder::StructuredSDFGBuilder& builder, const nlohmann::json& j);
57
60};
61
62} // namespace fp_math
63} // namespace sdfg
Access nodes for reading/writing data in the dataflow graph.
Definition analysis.h:53
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
Node representing access to a data container in the dataflow graph.
Definition access_node.h:84
Edge in the dataflow graph representing data movement.
Definition memlet.h:131
Simple computational operation in the dataflow graph.
Definition tasklet.h:348
data_flow::Tasklet * fma() const
The fused multiply-add tasklet created by apply(), or nullptr before.
virtual std::string name() const override
Get the name of this transformation.
virtual void apply(builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
Apply this transformation to the SDFG.
static FuseFMA from_json(builder::StructuredSDFGBuilder &builder, const nlohmann::json &j)
virtual void to_json(nlohmann::json &j) const override
Serialize this transformation to JSON.
virtual bool can_be_applied(builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
Check if this transformation can be safely applied.
FuseFMA(data_flow::Tasklet &add, bool invalidate_analysis=true)
Base class for all SDFG transformations.
Definition transformation.h:25
Edges in the dataflow graph representing data movement.
Definition function_builder.h:10
Definition kernel_builder.h:18
Definition analysis.h:7
Simple computational operations in the dataflow graph.