docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::transformations::MultiLevelTiling Class Reference

Multi-level loop tiling transformation. More...

#include <sdfg/transformations/multi_level_tiling.h>

Inheritance diagram for sdfg::transformations::MultiLevelTiling:
[legend]

Public Member Functions

 MultiLevelTiling (structured_control_flow::StructuredLoop &loop, size_t tile_size, size_t tile_size_2, bool simplify_bounds=true)
 Construct a two-level loop tiling transformation.
 MultiLevelTiling (structured_control_flow::StructuredLoop &loop, const std::vector< size_t > &tile_sizes, bool simplify_bounds=true)
 Construct a multi-level loop tiling transformation.
std::string name () const override
 Get the name of this transformation.
bool can_be_applied (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
 Check if this transformation can be applied.
void apply (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
 Apply the loop tiling transformation.
void to_json (nlohmann::json &j) const override
 Serialize this transformation to JSON.
const std::vector< structured_control_flow::StructuredLoop * > & middle_loops ()
structured_control_flow::StructuredLoop * middle_loop (size_t idx)
structured_control_flow::StructuredLoop * middle_loop ()
Public Member Functions inherited from sdfg::transformations::LoopTiling
 LoopTiling (structured_control_flow::StructuredLoop &loop, size_t tile_size, bool simplify_bounds=true)
 Construct a loop tiling transformation.
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 MultiLevelTiling from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j)
Static Public Member Functions inherited from sdfg::transformations::LoopTiling
static LoopTiling from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j)
 Deserialize a loop tiling transformation from JSON.

Additional Inherited Members

Protected Member Functions inherited from sdfg::transformations::LoopTiling
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 inherited from sdfg::transformations::LoopTiling
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 inherited from sdfg::transformations::LoopTiling
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

Detailed Description

Multi-level loop tiling transformation.

This transformation extends LoopTiling by applying multiple levels of tiling. Therefore, at least two tile sizes are expected. For n tile sizes, the result is n + 1 nested loops: n loops that iterate over the corresponding tile size, and an innermost loop that iterates over individual elements.

Note
The outermost tile size must be greater than 1.
Every inner tile size must be greate than 1 and less than the tile size from one level outter.
Every tile size must be divisible by the tile size one level inner.

Constructor & Destructor Documentation

◆ MultiLevelTiling() [1/2]

sdfg::transformations::MultiLevelTiling::MultiLevelTiling ( structured_control_flow::StructuredLoop & loop,
size_t tile_size,
size_t tile_size_2,
bool simplify_bounds = true )

Construct a two-level loop tiling transformation.

Parameters
loopThe loop to be tiled
tile_sizeThe size of the outer tile (must be > 1)
tile_size_2The size of the inner tile (must be > 1 and < tile_size)
simplify_boundsDrop the redundant inner bound for perfectly dividing tiles at both levels (see LoopTiling::tile_loop)

◆ MultiLevelTiling() [2/2]

sdfg::transformations::MultiLevelTiling::MultiLevelTiling ( structured_control_flow::StructuredLoop & loop,
const std::vector< size_t > & tile_sizes,
bool simplify_bounds = true )

Construct a multi-level loop tiling transformation.

Parameters
loopThe loop to be tiled
tile_sizesThe tile sizes (must be at least 2)
simplify_boundsDrop the redundant inner bound for perfectly dividing tiles at all levels (see LoopTiling::tile_loop)

Member Function Documentation

◆ apply()

void sdfg::transformations::MultiLevelTiling::apply ( builder::StructuredSDFGBuilder & builder,
analysis::AnalysisManager & analysis_manager )
overridevirtual

Apply the loop tiling transformation.

Parameters
builderThe SDFG builder
analysis_managerThe analysis manager

Reimplemented from sdfg::transformations::LoopTiling.

◆ can_be_applied()

bool sdfg::transformations::MultiLevelTiling::can_be_applied ( builder::StructuredSDFGBuilder & builder,
analysis::AnalysisManager & analysis_manager )
overridevirtual

Check if this transformation can be applied.

Parameters
builderThe SDFG builder
analysis_managerThe analysis manager
Returns
true if the transformation can be applied safely

Reimplemented from sdfg::transformations::LoopTiling.

◆ from_json()

MultiLevelTiling sdfg::transformations::MultiLevelTiling::from_json ( builder::StructuredSDFGBuilder & builder,
const nlohmann::json & j )
static

◆ middle_loop() [1/2]

structured_control_flow::StructuredLoop * sdfg::transformations::MultiLevelTiling::middle_loop ( )
Deprecated
Kept for backwards compatibility

◆ middle_loop() [2/2]

structured_control_flow::StructuredLoop * sdfg::transformations::MultiLevelTiling::middle_loop ( size_t idx)

◆ middle_loops()

const std::vector< structured_control_flow::StructuredLoop * > & sdfg::transformations::MultiLevelTiling::middle_loops ( )

◆ name()

std::string sdfg::transformations::MultiLevelTiling::name ( ) const
overridevirtual

Get the name of this transformation.

Returns
"LoopTiling"

Reimplemented from sdfg::transformations::LoopTiling.

◆ to_json()

void sdfg::transformations::MultiLevelTiling::to_json ( nlohmann::json & j) const
overridevirtual

Serialize this transformation to JSON.

Parameters
jJSON object to populate

Reimplemented from sdfg::transformations::LoopTiling.


The documentation for this class was generated from the following file: