|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Loop skewing transformation for nested loops. More...
#include <sdfg/transformations/loop_skewing.h>
Public Member Functions | |
| LoopSkewing (structured_control_flow::StructuredLoop &outer_loop, structured_control_flow::StructuredLoop &inner_loop, int skew_factor=1) | |
| Construct a new Loop Skewing transformation. | |
| virtual std::string | name () const override |
| Get the name of this transformation. | |
| virtual bool | can_be_applied (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override |
| Check if this transformation can be safely applied. | |
| virtual void | apply (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override |
| Apply this transformation to the SDFG. | |
| virtual void | to_json (nlohmann::json &j) const override |
| Serialize this transformation to JSON. | |
| Public Member Functions inherited from sdfg::transformations::Transformation | |
| virtual | ~Transformation ()=default |
| virtual void | set_report (PassReportConsumer *report) |
| Set the report consumer for transformation feedback. | |
| virtual bool | try_apply (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) |
| Attempt to apply the transformation if possible. | |
Static Public Member Functions | |
| static LoopSkewing | from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j) |
Additional Inherited Members | |
| Protected Attributes inherited from sdfg::transformations::Transformation | |
| PassReportConsumer * | report_ = nullptr |
Loop skewing transformation for nested loops.
This transformation applies loop skewing to two nested loops by adjusting the inner loop's iteration space to depend on the outer loop's iteration variable.
Loop skewing is useful for:
Transformation: for (i = lb_i; i < ub_i; i++) for (j = lb_j; j < ub_j; j++) body[i][j]
Becomes: for (i' = lb_i; i' < ub_i; i'++) for (j' = lb_j + skew_factor * (i' - lb_i); j' < ub_j + skew_factor * (i' - lb_i); j'++) body[i'][j' - skew_factor * (i' - lb_i)]
Implementation:
Prerequisites:
| sdfg::transformations::LoopSkewing::LoopSkewing | ( | structured_control_flow::StructuredLoop & | outer_loop, |
| structured_control_flow::StructuredLoop & | inner_loop, | ||
| int | skew_factor = 1 ) |
Construct a new Loop Skewing transformation.
| outer_loop | The outer loop to skew |
| inner_loop | The inner loop to skew |
| skew_factor | The skewing factor (default: 1) |
|
overridevirtual |
Apply this transformation to the SDFG.
| builder | The SDFG builder |
| analysis_manager | The analysis manager (may be invalidated) |
Implements sdfg::transformations::Transformation.
|
overridevirtual |
Check if this transformation can be safely applied.
| builder | The SDFG builder |
| analysis_manager | The analysis manager providing necessary analyses |
Implements sdfg::transformations::Transformation.
|
static |
|
overridevirtual |
Get the name of this transformation.
Implements sdfg::transformations::Transformation.
|
overridevirtual |
Serialize this transformation to JSON.
| j | JSON object to populate with transformation description |
| std::logic_error | if not implemented |
Implements sdfg::transformations::Transformation.