MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
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. More...
 
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. More...
 
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. More...
 

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 352 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 277 of file Utils.cpp.

References mlir::scf::buildLoopNest(), mlir::detail::enumerate(), mlir::scf::LoopNest::loops, mlir::affine::mapLoopToProcessorIds(), 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 487 of file Utils.cpp.

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

◆ doit() [3/4]

template<typename LoopTy >
static 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

Referenced by linalgOpToLoopsImpl().

◆ 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 320 of file Utils.cpp.

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


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