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

Splits a fused multiply-add into a multiplication and an addition. More...

#include <sdfg/fp_math/transformations/unfuse_fma.h>

Inheritance diagram for sdfg::fp_math::UnfuseFMA:
[legend]

Public Member Functions

 UnfuseFMA (data_flow::Tasklet &fma)
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.
data_flow::Tasklet * multiply () const
 The fp_mul tasklet created by apply(), or nullptr before.
data_flow::Tasklet * add () const
 The fp_add tasklet created by apply(), or nullptr before.
const std::string & product () const
 The transient scalar holding the product, 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 UnfuseFMA 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 fused multiply-add into a multiplication and an addition.

Replaces an fp_fma tasklet d = fma(a, b, c) by t = a * b and d = t + c, where t is a new transient scalar of the result's precision. This is the inverse of FuseFMA and reintroduces the intermediate rounding of the product, e.g. so that a later transformation can hand t on to another computation.

Constructor & Destructor Documentation

◆ UnfuseFMA()

sdfg::fp_math::UnfuseFMA::UnfuseFMA ( data_flow::Tasklet & fma)
explicit

Member Function Documentation

◆ add()

data_flow::Tasklet * sdfg::fp_math::UnfuseFMA::add ( ) const

The fp_add tasklet created by apply(), or nullptr before.

◆ apply()

virtual void sdfg::fp_math::UnfuseFMA::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::fp_math::UnfuseFMA::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()

UnfuseFMA sdfg::fp_math::UnfuseFMA::from_json ( builder::StructuredSDFGBuilder & builder,
const nlohmann::json & j )
static

◆ multiply()

data_flow::Tasklet * sdfg::fp_math::UnfuseFMA::multiply ( ) const

The fp_mul tasklet created by apply(), or nullptr before.

◆ name()

virtual std::string sdfg::fp_math::UnfuseFMA::name ( ) const
overridevirtual

Get the name of this transformation.

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

Implements sdfg::transformations::Transformation.

◆ product()

const std::string & sdfg::fp_math::UnfuseFMA::product ( ) const

The transient scalar holding the product, empty before apply().

◆ to_json()

virtual void sdfg::fp_math::UnfuseFMA::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: