|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Map fusion transformation that fuses two sequential maps. More...
#include <sdfg/transformations/map_fusion.h>
Public Member Functions | |
| MapFusion (structured_control_flow::Map &first_map, structured_control_flow::StructuredLoop &second_loop, bool require_consecutive=true, bool allow_init_hoist=true, bool allow_prod_into_cons=true) | |
| Construct a map fusion transformation. | |
| passes::loop_fusion::LoopFusionByAccessWorker::FusionDirection | last_fusion_direction () const |
| 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 map fusion 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 MapFusion | from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j) |
| Deserialize a map fusion transformation from JSON. | |
Friends | |
| class | FusionConsumerUpdateVisitor |
Additional Inherited Members | |
| Protected Attributes inherited from sdfg::transformations::Transformation | |
| PassReportConsumer * | report_ = nullptr |
Map fusion transformation that fuses two sequential maps.
This transformation fuses two sequential maps (children of the same sequence) when the second map reads from containers that are written by the first map.
Supports three patterns:
| sdfg::transformations::MapFusion::MapFusion | ( | structured_control_flow::Map & | first_map, |
| structured_control_flow::StructuredLoop & | second_loop, | ||
| bool | require_consecutive = true, | ||
| bool | allow_init_hoist = true, | ||
| bool | allow_prod_into_cons = true ) |
Construct a map fusion transformation.
| first_map | The first map (producer) to be fused |
| second_loop | The second loop (consumer, can be Map or For) to be fused |
| require_consecutive | Whether the maps must be consecutive in the sequence for fusion to be applied |
| allow_init_hoist | Whether Case 2 (init-into-reduction hoisting) may be applied |
| allow_prod_into_cons | Allow ProducerIntoConsumer fusions |
|
overridevirtual |
Apply the map fusion transformation.
Inlines the producer computation from the first map into the second map, eliminating intermediate storage accesses.
| builder | The SDFG builder |
| analysis_manager | The analysis manager |
Implements sdfg::transformations::Transformation.
|
overridevirtual |
Check if this transformation can be applied.
| builder | The SDFG builder |
| analysis_manager | The analysis manager |
Implements sdfg::transformations::Transformation.
|
static |
Deserialize a map fusion transformation from JSON.
| builder | The SDFG builder |
| j | JSON description of the transformation |
| passes::loop_fusion::LoopFusionByAccessWorker::FusionDirection sdfg::transformations::MapFusion::last_fusion_direction | ( | ) | const |
|
overridevirtual |
Get the name of this transformation.
Implements sdfg::transformations::Transformation.
|
overridevirtual |
Serialize this transformation to JSON.
| j | JSON object to populate |
Implements sdfg::transformations::Transformation.
|
friend |