docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
software_pipelining.h
Go to the documentation of this file.
1#pragma once
2
3#include <set>
4#include <string>
5#include <vector>
6
8
9namespace sdfg {
10class Function;
12class ControlFlowNode;
13class StructuredLoop;
14} // namespace structured_control_flow
15namespace transformations {
16
43 size_t stages_;
44 // When the loop stages two operands and shared memory can only hold a
45 // double buffer of one of them at the target occupancy, pipeline just the
46 // first (name-ordered) operand and leave the rest single-buffered +
47 // synchronous. This keeps occupancy (fewer shared bytes) while still
48 // overlapping the costlier operand's global load.
49 bool single_operand_;
50 // Register-staged mode: keep one shared buffer and split each staging copy into a
51 // load into registers (issued for panel p+1 before compute p) and a store into the
52 // buffer after compute p, fenced by barriers:
53 // prologue: copy panel 0; barrier
54 // for p: [p+1 < n: load p+1 -> regs]; compute p; barrier; [p+1 < n: regs -> buf]; barrier
55 bool register_staged_;
56
57public:
60 size_t stages = 2,
61 bool single_operand = false,
62 bool register_staged = false
63 );
64
65 virtual std::string name() const override;
66
78 static std::set<std::string>
80
94 static std::vector<structured_control_flow::StructuredLoop*>
96
97 virtual bool
99
100 virtual void apply(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) override;
101
102 virtual void to_json(nlohmann::json& j) const override;
103
105};
106
107} // namespace transformations
108} // namespace sdfg
Definition function.h:43
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
Base class for all structured control flow nodes in a StructuredSDFG.
Definition control_flow_node.h:44
Base class for structured loop constructs.
Definition structured_loop.h:244
static SoftwarePipelining 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.
static std::vector< structured_control_flow::StructuredLoop * > staging_panels(const Function &function, structured_control_flow::ControlFlowNode &root)
The candidate panel loops under root this transformation can target.
virtual std::string name() const override
Get the name of this transformation.
SoftwarePipelining(structured_control_flow::StructuredLoop &loop, size_t stages=2, bool single_operand=false, bool register_staged=false)
static std::set< std::string > copied_in_buffers(const Function &function, structured_control_flow::ControlFlowNode &root)
The async-stageable buffers the copy-in nodes under root fill: the containers a pipeline would multi-...
virtual void apply(builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
Apply this transformation to the SDFG.
Base class for all SDFG transformations.
Definition transformation.h:25
Definition function_builder.h:10
Definition language_extension.h:18
Definition loop_parallelization.h:8
Definition analysis.h:7