MLIR 22.0.0git
mlir::linalg::GenerateLoopNest< LoopTy > Struct Template Reference

Utility class used to generate nested loops with ranges described by loopRanges and loop type described by the iteratorTypes. More...

#include "mlir/Dialect/Linalg/Utils/Utils.h"

Public Member Functions

void doit (OpBuilder &b, Location loc, ArrayRef< Range > loopRanges, LinalgOp linalgOp, ArrayRef< utils::IteratorType > iteratorTypes, function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn, ArrayRef< linalg::ProcInfo > procInfo)
 Specialization to build an scf "for" nest.
void doit (OpBuilder &b, Location loc, ArrayRef< Range > loopRanges, LinalgOp linalgOp, ArrayRef< utils::IteratorType > iteratorTypes, function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn, ArrayRef< linalg::ProcInfo >)
 Specialization to build affine "for" nest.
void doit (OpBuilder &b, Location loc, ArrayRef< Range > loopRanges, LinalgOp linalgOp, ArrayRef< utils::IteratorType > iteratorTypes, function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn, ArrayRef< linalg::ProcInfo > procInfo)
 Specialization for generating a mix of parallel and sequential scf loops.

Static Public Member Functions

static void doit (OpBuilder &b, Location loc, ArrayRef< Range > loopRanges, LinalgOp linalgOp, ArrayRef< utils::IteratorType > iteratorTypes, function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn, ArrayRef< linalg::ProcInfo > procInfo={})

Detailed Description

template<typename LoopTy>
struct mlir::linalg::GenerateLoopNest< LoopTy >

Utility class used to generate nested loops with ranges described by loopRanges and loop type described by the iteratorTypes.

bodyBuilderFn is used to generate the body of the innermost loop. It is passed a range of loop induction variables and a range of operand values to use.

Definition at line 376 of file Utils.h.

Member Function Documentation

◆ doit() [1/4]

void mlir::linalg::GenerateLoopNest< scf::ForOp >::doit ( OpBuilder & b,
Location loc,
ArrayRef< Range > loopRanges,
LinalgOp linalgOp,
ArrayRef< utils::IteratorType > iteratorTypes,
function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn,
ArrayRef< linalg::ProcInfo > procInfo )

Specialization to build an scf "for" nest.

Definition at line 1208 of file Utils.cpp.

References b, mlir::scf::buildLoopNest(), mlir::linalg::Cyclic, mlir::scf::LoopNest::loops, and unpackRanges().

◆ doit() [2/4]

void mlir::linalg::GenerateLoopNest< scf::ParallelOp >::doit ( OpBuilder & b,
Location loc,
ArrayRef< Range > loopRanges,
LinalgOp linalgOp,
ArrayRef< utils::IteratorType > iteratorTypes,
function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn,
ArrayRef< linalg::ProcInfo > procInfo )

Specialization for generating a mix of parallel and sequential scf loops.

Definition at line 1418 of file Utils.cpp.

References b, mlir::linalg::generateParallelLoopNest(), mlir::linalg::None, unpackRanges(), and mlir::linalg::updateBoundsForCyclicDistribution().

◆ doit() [3/4]

template<typename LoopTy>
void mlir::linalg::GenerateLoopNest< LoopTy >::doit ( OpBuilder & b,
Location loc,
ArrayRef< Range > loopRanges,
LinalgOp linalgOp,
ArrayRef< utils::IteratorType > iteratorTypes,
function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn,
ArrayRef< linalg::ProcInfo > procInfo = {} )
static

References b.

Referenced by tileLinalgOpImpl().

◆ doit() [4/4]

void mlir::linalg::GenerateLoopNest< AffineForOp >::doit ( OpBuilder & b,
Location loc,
ArrayRef< Range > loopRanges,
LinalgOp linalgOp,
ArrayRef< utils::IteratorType > iteratorTypes,
function_ref< scf::ValueVector(OpBuilder &, Location, ValueRange, ValueRange)> bodyBuilderFn,
ArrayRef< linalg::ProcInfo >  )

Specialization to build affine "for" nest.

Definition at line 1251 of file Utils.cpp.

References b, mlir::affine::buildAffineLoopNest(), mlir::getConstantIntValue(), and unpackRanges().


The documentation for this struct was generated from the following file: