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

Loop distribution (loop fission) transformation. More...

#include <sdfg/transformations/loop_distribute.h>

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

Public Member Functions

 LoopDistribute (structured_control_flow::StructuredLoop &loop, structured_control_flow::ControlFlowNode &child)
 Construct a loop distribute transformation.
 LoopDistribute (structured_control_flow::StructuredLoop &loop)
 Construct a loop distribute transformation on the first child of the loop.
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 distribute transformation.
virtual void to_json (nlohmann::json &j) const override
 Serialize this transformation to JSON.
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 LoopDistribute from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j)
 Deserialize a loop distribute transformation from JSON.

Additional Inherited Members

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

Detailed Description

Loop distribution (loop fission) transformation.

This transformation splits a loop with multiple children into separate loops, each containing one child. This can enable better optimization opportunities by isolating different computations into separate loops.

Loop distribution is applied incrementally, distributing the first child into a separate loop each time it is applied.

Note
The loop must have at least 2 children
Transitions must not have assignments
The first child must not write to loop-local containers used by other children
Dependencies must be either child-local WAW or not used by the child

Constructor & Destructor Documentation

◆ LoopDistribute() [1/2]

sdfg::transformations::LoopDistribute::LoopDistribute ( structured_control_flow::StructuredLoop & loop,
structured_control_flow::ControlFlowNode & child )

Construct a loop distribute transformation.

Parameters
loopThe loop to be distributed
childThe child to be distributed into a separate loop

◆ LoopDistribute() [2/2]

sdfg::transformations::LoopDistribute::LoopDistribute ( structured_control_flow::StructuredLoop & loop)

Construct a loop distribute transformation on the first child of the loop.

Parameters
loopThe loop to be distributed

Member Function Documentation

◆ apply()

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

Apply the loop distribute transformation.

Parameters
builderThe SDFG builder
analysis_managerThe analysis manager

Implements sdfg::transformations::Transformation.

◆ can_be_applied()

virtual bool sdfg::transformations::LoopDistribute::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

Implements sdfg::transformations::Transformation.

◆ from_json()

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

Deserialize a loop distribute transformation from JSON.

Parameters
builderThe SDFG builder
jJSON description of the transformation
Returns
The deserialized transformation

◆ name()

virtual std::string sdfg::transformations::LoopDistribute::name ( ) const
overridevirtual

Get the name of this transformation.

Returns
"LoopDistribute"

Implements sdfg::transformations::Transformation.

◆ to_json()

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

Serialize this transformation to JSON.

Parameters
jJSON object to populate

Implements sdfg::transformations::Transformation.


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