|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Non-destructive detection of einsum clusters in a StructuredSDFG. More...
#include <sdfg/einsum/einsum_detection.h>
Classes | |
| struct | BlockState |
| struct | LoopScopeState |
Protected Member Functions | |
| EinsumCluster & | new_cluster (structured_control_flow::Block &block) |
| EinsumCluster * | try_lift (structured_control_flow::Block &block, data_flow::Tasklet &tasklet) |
| Try to lift a reduction tasklet into a fresh einsum cluster core. | |
| EinsumCluster * | from_einsum_node (structured_control_flow::Block &block, EinsumNode &einsum_node) |
| Mirror an already existing EinsumNode into a cluster. | |
| PromotionCheck | can_promote (EinsumCluster &cluster, structured_control_flow::StructuredLoop &loop) |
| Verify the loop can be folded and return the new dimension's per-operand contributions. | |
| void | apply_promote (EinsumCluster &cluster, structured_control_flow::StructuredLoop &loop, const PromotionCheck &check) |
| void | recompute_einsum_indices (EinsumCluster &cluster) |
| Recompute the per-operand inner-index mappings from the current dims and subsets. | |
| bool | block_fully_consumed (BlockState &state, structured_control_flow::Block &block) |
| void | register_cluster_in_scope (EinsumCluster *cluster) |
Static Protected Member Functions | |
| static bool | subsets_eq (const data_flow::Subset &subset1, const data_flow::Subset &subset2) |
| static bool | try_extend (BlockState &state, EinsumCluster &cluster) |
| Try to fold a multiplication feeding an input into the cluster. Returns true if applied. | |
| static symbolic::Expression | cnf_to_upper_bound (const symbolic::CNF &cnf, const symbolic::Symbol indvar) |
| static bool | subset_contains_symbol (const data_flow::Subset &subset, const symbolic::Symbol &symbol) |
Protected Attributes | |
| std::vector< std::unique_ptr< EinsumCluster > > | all_einsums_ |
| all that have been found | |
| std::vector< LoopScopeState > | loop_stack_ |
| those that are relevant to the current scope. | |
Non-destructive detection of einsum clusters in a StructuredSDFG.
Traverses the graph from a user-chosen starting point, builds the loop stack and tries to represent each Block of dataflow with a single EinsumCluster. If a loop scope only contains a single EinsumCluster and no other operation, the loop is folded into that cluster on the way out of the scope.
The SDFG is never modified.
|
default |
|
protected |
|
protected |
|
protected |
Verify the loop can be folded and return the new dimension's per-operand contributions.
|
staticprotected |
| void sdfg::einsum::EinsumDetection::consume_input_operations | ( | BlockState & | state | ) |
for all the clusters of the block last scanned into BlockState, try to consume all the input operations that feed into them and are still unconsumed, and add them to the clusters.
|
inline |
All einsum clusters found during the last run.
| void sdfg::einsum::EinsumDetection::filter_for_coverage | ( | ) |
| void sdfg::einsum::EinsumDetection::find_einsum_core_ops | ( | BlockState & | state, |
| structured_control_flow::Block & | block ) |
Loop for operations (reductions) that can form the core of einsum clusters.
|
protected |
Mirror an already existing EinsumNode into a cluster.
|
overridevirtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
protected |
|
protected |
Recompute the per-operand inner-index mappings from the current dims and subsets.
|
protected |
| size_t sdfg::einsum::EinsumDetection::run | ( | structured_control_flow::ControlFlowNode & | start | ) |
Run detection starting from the given control flow node.
|
staticprotected |
|
staticprotected |
|
staticprotected |
Try to fold a multiplication feeding an input into the cluster. Returns true if applied.
|
protected |
Try to lift a reduction tasklet into a fresh einsum cluster core.
| bool sdfg::einsum::EinsumDetection::try_to_consume_loop | ( | EinsumCluster & | einsum, |
| structured_control_flow::StructuredLoop & | loop ) |
If there is a cluster representing the full contents of the loop, try to have it consume this loop.
| state | |
| loop |
|
virtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
virtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
| bool sdfg::visitor::ActualStructuredSDFGVisitor::visit | ( | sdfg::structured_control_flow::ControlFlowNode & | node | ) |
|
virtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
virtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
virtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
virtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
overridevirtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
overridevirtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
overridevirtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
overridevirtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
overridevirtual |
Reimplemented from sdfg::visitor::ActualStructuredSDFGVisitor.
|
protected |
all that have been found
|
protected |
those that are relevant to the current scope.