|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Loop tiling (blocking) transformation. More...
#include <sdfg/transformations/loop_tiling.h>
Public Member Functions | |
| LoopTiling (structured_control_flow::StructuredLoop &loop, size_t tile_size, bool simplify_bounds=true) | |
| Construct a loop tiling 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 applied. | |
| virtual void | apply (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override |
| Apply the loop tiling transformation. | |
| virtual void | to_json (nlohmann::json &j) const override |
| Serialize this transformation to JSON. | |
| structured_control_flow::StructuredLoop * | inner_loop () |
| structured_control_flow::StructuredLoop * | outer_loop () |
| 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 LoopTiling | from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j) |
| Deserialize a loop tiling transformation from JSON. | |
Protected Member Functions | |
| bool | reduction_buffers_supported (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager, const std::vector< size_t > &tile_sizes) const |
| Check reduction footprints using symbolic tile domains without changing the graph. | |
Static Protected Member Functions | |
| static structured_control_flow::StructuredLoop & | tile_loop (builder::StructuredSDFGBuilder &builder, structured_control_flow::StructuredLoop &loop, size_t tile_size, bool simplify_bounds=true) |
| Tile a single loop into an outer tile loop and an inner element loop. | |
Protected Attributes | |
| structured_control_flow::StructuredLoop & | loop_ |
| size_t | tile_size_ |
| bool | simplify_bounds_ = true |
| bool | applied_ = false |
| structured_control_flow::StructuredLoop * | inner_loop_ = nullptr |
| structured_control_flow::StructuredLoop * | outer_loop_ = nullptr |
| Protected Attributes inherited from sdfg::transformations::Transformation | |
| PassReportConsumer * | report_ = nullptr |
Loop tiling (blocking) transformation.
This transformation splits a loop into two nested loops: an outer loop that iterates over tiles and an inner loop that iterates within each tile. Loop tiling improves data locality by ensuring that data accessed within a tile fits in cache.
| sdfg::transformations::LoopTiling::LoopTiling | ( | structured_control_flow::StructuredLoop & | loop, |
| size_t | tile_size, | ||
| bool | simplify_bounds = true ) |
Construct a loop tiling transformation.
| loop | The loop to be tiled |
| tile_size | The size of each tile (must be > 1) |
| simplify_bounds | Drop the redundant inner bound for perfectly dividing tiles (see tile_loop) |
|
overridevirtual |
Apply the loop tiling transformation.
| builder | The SDFG builder |
| analysis_manager | The analysis manager |
Implements sdfg::transformations::Transformation.
Reimplemented in sdfg::transformations::MultiLevelTiling.
|
overridevirtual |
Check if this transformation can be applied.
| builder | The SDFG builder |
| analysis_manager | The analysis manager |
Implements sdfg::transformations::Transformation.
Reimplemented in sdfg::transformations::MultiLevelTiling.
|
static |
Deserialize a loop tiling transformation from JSON.
| builder | The SDFG builder |
| j | JSON description of the transformation |
| structured_control_flow::StructuredLoop * sdfg::transformations::LoopTiling::inner_loop | ( | ) |
|
overridevirtual |
Get the name of this transformation.
Implements sdfg::transformations::Transformation.
Reimplemented in sdfg::transformations::MultiLevelTiling.
| structured_control_flow::StructuredLoop * sdfg::transformations::LoopTiling::outer_loop | ( | ) |
|
protected |
Check reduction footprints using symbolic tile domains without changing the graph.
| builder | The builder for the unchanged original SDFG |
| analysis_manager | The analysis manager for the current graph |
| tile_sizes | Tile sizes in application order, each applied to the inner loop |
|
staticprotected |
Tile a single loop into an outer tile loop and an inner element loop.
Splits loop in place: loop becomes the inner (element) loop and a new outer loop iterating over tiles is created before it. Map/Reduce loops preserve their schedule/reductions on the outer loop, while a tiled Map's inner loop is converted to a sequential schedule to avoid repeated GPU dimensions.
| builder | The SDFG builder |
| loop | The loop to tile (becomes the inner loop) |
| tile_size | The size of each tile (must be > 1) |
| simplify_bounds | Drop the redundant original bound on the inner loop when the tile evenly divides the (constant) trip count, yielding a clean constant-trip tile that unrolls/vectorizes and leaves no redundant guards for later peeling. |
|
overridevirtual |
Serialize this transformation to JSON.
| j | JSON object to populate |
Implements sdfg::transformations::Transformation.
Reimplemented in sdfg::transformations::MultiLevelTiling.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |