|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Tile fusion transformation that merges two consecutive sibling tiled Maps. More...
#include <sdfg/tiles/transformations/tile_fusion.h>
Public Member Functions | |
| TileFusion (structured_control_flow::Map &first_map, structured_control_flow::Map &second_map) | |
| Construct a tile fusion 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. | |
| structured_control_flow::StructuredLoop * | fused_loop () const |
| Get the fused For loop (only valid after apply). | |
| int | radius () const |
| Get the computed radius (only valid after can_be_applied returns true). | |
| 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 TileFusion | from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j) |
Additional Inherited Members | |
| Protected Attributes inherited from sdfg::transformations::Transformation | |
| PassReportConsumer * | report_ = nullptr |
Tile fusion transformation that merges two consecutive sibling tiled Maps.
Takes two consecutive tiled Maps (each the result of LoopTiling applied to a Map) that communicate through an intermediate array and merges their outer tile loops into a single For loop. The producer's inner iteration range is extended by the computed stencil radius to cover cross-tile reads by the consumer.
Before: map i_tile step S: map i: B[f(i)] = ...A... // producer map j_tile step S: map j: A[g(j)] = ...B... // consumer
After: for tile step S: // For (cross-tile deps) map i = max(0, tile-r)..min(tile+S+r, N): K1 // extended by radius r map j = tile..min(tile+S, N): K2 // unchanged
This is the structural enabler for diamond tiling on multi-kernel stencils.
| sdfg::transformations::TileFusion::TileFusion | ( | structured_control_flow::Map & | first_map, |
| structured_control_flow::Map & | second_map ) |
|
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 |
| structured_control_flow::StructuredLoop * sdfg::transformations::TileFusion::fused_loop | ( | ) | const |
Get the fused For loop (only valid after apply).
|
overridevirtual |
Get the name of this transformation.
Implements sdfg::transformations::Transformation.
| int sdfg::transformations::TileFusion::radius | ( | ) | const |
Get the computed radius (only valid after can_be_applied returns true).
|
overridevirtual |
Serialize this transformation to JSON.
| j | JSON object to populate with transformation description |
| std::logic_error | if not implemented |
Implements sdfg::transformations::Transformation.