MLIR  15.0.0git
Typedefs | Functions
mlir::async Namespace Reference

Typedefs

using AsyncMinTaskSizeComputationFunction = std::function< Value(ImplicitLocOpBuilder, scf::ParallelOp)>
 Emit the IR to compute the minimum number of iterations of scf.parallel body that would be viable for a single parallel task. More...
 

Functions

bool isRefCounted (Type type)
 Returns true if the type is reference counted at runtime. More...
 
void populateAsyncParallelForPatterns (RewritePatternSet &patterns, bool asyncDispatch, int32_t numWorkerThreads, const AsyncMinTaskSizeComputationFunction &computeMinTaskSize)
 Add a pattern to the given pattern list to lower scf.parallel to async operations. More...
 
void cloneConstantsIntoTheRegion (Region &region)
 Clone ConstantLike operations that are defined above the given region and have users in the region into the region entry block. More...
 
void cloneConstantsIntoTheRegion (Region &region, OpBuilder &builder)
 

Typedef Documentation

◆ AsyncMinTaskSizeComputationFunction

using mlir::async::AsyncMinTaskSizeComputationFunction = typedef std::function<Value(ImplicitLocOpBuilder, scf::ParallelOp)>

Emit the IR to compute the minimum number of iterations of scf.parallel body that would be viable for a single parallel task.

Allows the user to avoid incurring the overheads of spawning costly parallel tasks in absence of sufficient amount of parallelizable work.

Must return an index type.

Definition at line 29 of file Transforms.h.

Function Documentation

◆ cloneConstantsIntoTheRegion() [1/2]

void mlir::async::cloneConstantsIntoTheRegion ( Region region)

Clone ConstantLike operations that are defined above the given region and have users in the region into the region entry block.

We do that to reduce the number of function arguments when we outline async.execute and scf.parallel operations body into functions.

Definition at line 15 of file PassDetail.cpp.

Referenced by doSequentialDispatch(), and outlineExecuteOp().

◆ cloneConstantsIntoTheRegion() [2/2]

void mlir::async::cloneConstantsIntoTheRegion ( Region region,
OpBuilder builder 
)

◆ isRefCounted()

bool mlir::async::isRefCounted ( Type  type)
inline

Returns true if the type is reference counted at runtime.

Definition at line 49 of file Async.h.

References mlir::Type::isa().

Referenced by walkReferenceCountedValues().

◆ populateAsyncParallelForPatterns()

void mlir::async::populateAsyncParallelForPatterns ( RewritePatternSet patterns,
bool  asyncDispatch,
int32_t  numWorkerThreads,
const AsyncMinTaskSizeComputationFunction computeMinTaskSize 
)

Add a pattern to the given pattern list to lower scf.parallel to async operations.

Definition at line 949 of file AsyncParallelFor.cpp.

References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().

Referenced by doSequentialDispatch().