|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Loop interchange transformation that swaps two nested loops. More...
#include <sdfg/transformations/loop_interchange.h>
Public Member Functions | |
| LoopInterchange (structured_control_flow::StructuredLoop &outer_loop, structured_control_flow::StructuredLoop &inner_loop) | |
| Construct a loop interchange transformation. | |
| virtual std::string | name () const override |
| Get the name of this transformation. | |
| LoopSwap | proposal (analysis::AnalysisManager *analysis_manager=nullptr) const |
| Compute the interchanged loop headers without modifying the SDFG. | |
| virtual bool | can_be_applied (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override |
| Check if this transformation can be applied. | |
| virtual void | apply (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override |
| Apply the loop interchange transformation. | |
| virtual void | to_json (nlohmann::json &j) const override |
| Serialize this transformation to JSON. | |
| structured_control_flow::StructuredLoop * | new_outer_loop () const |
| structured_control_flow::StructuredLoop * | new_inner_loop () const |
| 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 LoopInterchange | from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j) |
| Deserialize a loop interchange transformation from JSON. | |
Additional Inherited Members | |
| Protected Attributes inherited from sdfg::transformations::Transformation | |
| PassReportConsumer * | report_ = nullptr |
Loop interchange transformation that swaps two nested loops.
This transformation swaps the order of two nested loops (outer and inner), potentially improving data locality and parallelization opportunities. The transformation preserves the computational semantics while reordering loop execution.
Supports two cases:
| sdfg::transformations::LoopInterchange::LoopInterchange | ( | structured_control_flow::StructuredLoop & | outer_loop, |
| structured_control_flow::StructuredLoop & | inner_loop ) |
Construct a loop interchange transformation.
| outer_loop | The outer loop to be interchanged |
| inner_loop | The inner loop to be interchanged |
|
overridevirtual |
Apply the loop interchange transformation.
| builder | The SDFG builder |
| analysis_manager | The analysis manager |
Implements sdfg::transformations::Transformation.
|
overridevirtual |
Check if this transformation can be applied.
| builder | The SDFG builder |
| analysis_manager | The analysis manager |
Implements sdfg::transformations::Transformation.
|
static |
Deserialize a loop interchange transformation from JSON.
| builder | The SDFG builder |
| j | JSON description of the transformation |
|
overridevirtual |
Get the name of this transformation.
Implements sdfg::transformations::Transformation.
| structured_control_flow::StructuredLoop * sdfg::transformations::LoopInterchange::new_inner_loop | ( | ) | const |
| structured_control_flow::StructuredLoop * sdfg::transformations::LoopInterchange::new_outer_loop | ( | ) | const |
| LoopSwap sdfg::transformations::LoopInterchange::proposal | ( | analysis::AnalysisManager * | analysis_manager = nullptr | ) | const |
Compute the interchanged loop headers without modifying the SDFG.
Includes bound projection and inversion for dependent loops. Shared by the reduction-footprint preview and apply(); does not check dependence legality.
| analysis_manager | Optional; enables floor-division bounds whose numerator is provably non-negative |
|
overridevirtual |
Serialize this transformation to JSON.
| j | JSON object to populate |
Implements sdfg::transformations::Transformation.