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

Splits a map into nested maps along the divisions of its induction variable; the inverse of MapCollapse. More...

#include <sdfg/transformations/map_delinearize.h>

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

Public Member Functions

 MapDelinearize (structured_control_flow::Map &map)
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 safely applied.
void apply (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
 Apply this transformation to the SDFG.
void to_json (nlohmann::json &j) const override
 Serialize this transformation to JSON.
const std::vector< structured_control_flow::Map * > & maps () const
 The maps the map became, outermost first; empty before apply().
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 MapDelinearize from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j)

Additional Inherited Members

Protected Attributes inherited from sdfg::transformations::Transformation
PassReportConsumer * report_ = nullptr

Detailed Description

Splits a map into nested maps along the divisions of its induction variable; the inverse of MapCollapse.

Flattened loops, e.g. over the elements of a reshaped tensor or after fusing a nest into one, address data through divisions and remainders of the induction variable by constants, such as A[64*idiv(i, 256) + imod(i, 64)]. Each chain of divisions and remainders of i selects a range of its digits in a mixed radix: (i mod high) div low. If the bounds of all those ranges divide one another and the extent of the map, the map becomes one map per digit, outermost first, iterating in the same order, and each chain the weighted sum of its digits, which is affine.

Note
The map must be sequential, start at 0, step by 1 and have a constant extent.

Constructor & Destructor Documentation

◆ MapDelinearize()

sdfg::transformations::MapDelinearize::MapDelinearize ( structured_control_flow::Map & map)
explicit

Member Function Documentation

◆ apply()

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

Apply this transformation to the SDFG.

Parameters
builderThe SDFG builder
analysis_managerThe analysis manager (may be invalidated)

Implements sdfg::transformations::Transformation.

◆ can_be_applied()

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

Check if this transformation can be safely applied.

Parameters
builderThe SDFG builder
analysis_managerThe analysis manager providing necessary analyses
Returns
true if all preconditions are met

Implements sdfg::transformations::Transformation.

◆ from_json()

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

◆ maps()

const std::vector< structured_control_flow::Map * > & sdfg::transformations::MapDelinearize::maps ( ) const

The maps the map became, outermost first; empty before apply().

◆ name()

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

Get the name of this transformation.

Returns
The transformation name (e.g., "LoopInterchange")

Implements sdfg::transformations::Transformation.

◆ to_json()

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

Serialize this transformation to JSON.

Parameters
jJSON object to populate with transformation description
Exceptions
std::logic_errorif not implemented

Implements sdfg::transformations::Transformation.


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