MLIR 22.0.0git
mlir::sparse_tensor::IterationGraphSorter Class Reference

#include "Dialect/SparseTensor/Transforms/Utils/IterationGraphSorter.h"

Public Member Functions

AffineMap sort (SortMask mask, Value ignored=nullptr)
 Returns a permutation that represents the scheduled loop order.
unsigned getNumLoops () const
 Returns the number of loops in the iteration graph.

Static Public Member Functions

static IterationGraphSorter fromGenericOp (linalg::GenericOp genericOp, sparse_tensor::LoopOrderingStrategy strategy)
 Factory method that constructs an iteration graph sorter for the given linalg.generic operation with a specific loop ordering strategy.

Detailed Description

Definition at line 43 of file IterationGraphSorter.h.

Member Function Documentation

◆ fromGenericOp()

IterationGraphSorter IterationGraphSorter::fromGenericOp ( linalg::GenericOp genericOp,
sparse_tensor::LoopOrderingStrategy strategy )
static

Factory method that constructs an iteration graph sorter for the given linalg.generic operation with a specific loop ordering strategy.

Definition at line 133 of file IterationGraphSorter.cpp.

References mlir::sparse_tensor::hasAnyNonIdentityOperandsOrResults(), and mlir::sparse_tensor::hasAnySparseOperandOrResult().

◆ getNumLoops()

unsigned mlir::sparse_tensor::IterationGraphSorter::getNumLoops ( ) const
inline

Returns the number of loops in the iteration graph.

Definition at line 58 of file IterationGraphSorter.h.

◆ sort()

AffineMap IterationGraphSorter::sort ( SortMask mask,
Value ignored = nullptr )
nodiscard

Returns a permutation that represents the scheduled loop order.

Note that the returned AffineMap could be null if the kernel cannot be scheduled due to cyclic iteration graph.

Definition at line 185 of file IterationGraphSorter.cpp.

References mlir::sparse_tensor::getSparseTensorEncoding(), includesDenseInput(), and includesDenseOutput().


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