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

Marks a constant-trip loop for full unrolling. More...

#include <sdfg/transformations/unroll_transform.h>

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

Public Member Functions

 UnrollTransform (structured_control_flow::StructuredLoop &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 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.
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 UnrollTransform from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j)

Additional Inherited Members

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

Detailed Description

Marks a constant-trip loop for full unrolling.

Sets the "unroll" property on the loop's existing schedule (preserving its kind, e.g. SEQUENTIAL / CUDA), which the loop codegen lowers to #pragma clang loop unroll(full). Full unrolling of the constant-trip loops that index a register tile is what lets the compiler scalarize the tile into registers (instead of spilling it to local memory).

Only applicable to loops with a provably constant (positive integer) trip count, so unroll(full) is never emitted on a variable-trip loop (which the compiler would reject).

Constructor & Destructor Documentation

◆ UnrollTransform()

sdfg::transformations::UnrollTransform::UnrollTransform ( structured_control_flow::StructuredLoop & loop)
explicit

Member Function Documentation

◆ apply()

virtual void sdfg::transformations::UnrollTransform::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()

virtual bool sdfg::transformations::UnrollTransform::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()

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

◆ name()

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

Get the name of this transformation.

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

Implements sdfg::transformations::Transformation.

◆ to_json()

virtual void sdfg::transformations::UnrollTransform::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: