MLIR  21.0.0git
Classes | Typedefs | Functions | Variables
mlir::tosa Namespace Reference

Classes

struct  IsTosaConv
 
struct  IsTosaConv< tosa::Conv2DOp >
 
struct  IsTosaConv< tosa::DepthwiseConv2DOp >
 
struct  IsTosaConv< tosa::TransposeConv2DOp >
 
struct  IsTosaConv< tosa::Conv3DOp >
 
struct  ConvZpPair
 
struct  ValidationOptions
 
struct  ValueKnowledge
 Statically known information for a particular Value. More...
 

Typedefs

using FailOrMaybeZP = llvm::FailureOr< std::optional< ConvZpPair > >
 

Functions

std::unique_ptr< PasscreateTosaToArith (bool includeApplyRescale=false, bool use32BitApplyRescale=false)
 
void populateTosaToArithConversionPatterns (RewritePatternSet *patterns)
 
void populateTosaRescaleToArithConversionPatterns (RewritePatternSet *patterns, bool include32Bit=false)
 
std::unique_ptr< PasscreateTosaToLinalg ()
 
std::unique_ptr< PasscreateTosaToLinalgNamed (const TosaToLinalgNamedOptions &options=TosaToLinalgNamedOptions())
 
void addTosaToLinalgPasses (OpPassManager &pm, const TosaToLinalgOptions &options, const TosaToLinalgNamedOptions &tosaToLinalgNamedOptions=TosaToLinalgNamedOptions(), std::optional< tosa::TosaValidationOptions > validationOptions=tosa::TosaValidationOptions{ {"none"}, false, tosa::TosaLevelEnum::None})
 Populates passes to convert from TOSA to Linalg on buffers. More...
 
void registerTosaToLinalgPipelines ()
 Populates TOSA to linalg pipelines Currently, this includes only the "tosa-to-linalg-pipeline". More...
 
void populateTosaToLinalgConversionPatterns (const TypeConverter &converter, RewritePatternSet *patterns)
 Populates conversion passes from TOSA dialect to Linalg dialect. More...
 
void populateTosaToLinalgNamedConversionPatterns (const TypeConverter &converter, RewritePatternSet *patterns, const TosaToLinalgNamedOptions &options)
 Populates conversion passes from TOSA dialect to Linalg named operations. More...
 
void populateTosaToMLProgramConversionPatterns (RewritePatternSet *patterns)
 
std::unique_ptr< PasscreateTosaToSCF ()
 
void populateTosaToSCFConversionPatterns (RewritePatternSet *patterns)
 
void addTosaToSCFPasses (OpPassManager &pm)
 Populates passes to convert from TOSA to SCF. More...
 
std::unique_ptr< PasscreateTosaToTensor ()
 
void populateTosaToTensorConversionPatterns (const TypeConverter &converter, RewritePatternSet *patterns)
 
void registerShardingInterfaceExternalModels (DialectRegistry &registry)
 
ParseResult parseTypeOrAttr (OpAsmParser &parser, TypeAttr &typeAttr, Attribute &attr)
 
void printTypeOrAttr (OpAsmPrinter &p, Operation *op, TypeAttr type, Attribute attr)
 
bool isa_tosa_shape_type (mlir::Type t)
 
std::optional< ValuecreateZeroPointTensor (OpBuilder &builder, Location loc, Type srcElemType, int64_t zp=0)
 
LogicalResult getZeroPoint (ElementsAttr zpAttr, int64_t &zp)
 
template<typename T >
LogicalResult verifyZeroPoint (Type zpElemType, int64_t zp)
 
template<typename TosaConvOp >
std::enable_if_t< is_tosa_conv_v< TosaConvOp >, FailOrMaybeZPextractConvZpPair (TosaConvOp op, PatternRewriter &rewriter)
 
void populateTosaDecomposeConv2D (MLIRContext *ctx, RewritePatternSet &patterns)
 
void populateTosaDecomposeTransposeConv (MLIRContext *ctx, RewritePatternSet &patterns)
 
void populateTosaDecomposeDepthwise (MLIRContext *ctx, RewritePatternSet &patterns)
 
void populateTosaFoldConstantReciprocalPatterns (MLIRContext *ctx, RewritePatternSet &patterns)
 
void populateTosaFoldConstantTransposePatterns (MLIRContext *ctx, RewritePatternSet &patterns)
 
void populateTosaConstantReduction (MLIRContext *ctx, RewritePatternSet &patterns, bool aggressiveReduceConstant)
 
void populateTosaTypeConversion (TypeConverter &converter)
 
std::unique_ptr< PasscreateTosaLayerwiseConstantFoldPass ()
 
std::unique_ptr< PasscreateTosaLayerwiseConstantFoldPass (const TosaLayerwiseConstantFoldPassOptions &options)
 
std::unique_ptr< PasscreateTosaInferShapesPass ()
 
std::unique_ptr< PasscreateTosaMakeBroadcastablePass ()
 
std::unique_ptr< PasscreateTosaTestQuantUtilAPIPass ()
 
std::unique_ptr< PasscreateTosaOptionalDecompositions ()
 
SmallVector< utils::IteratorType > getNParallelLoopsAttrs (unsigned nParallelLoops)
 
SmallVector< ValuecondenseValues (const SmallVector< Value > &values)
 
Value clampFloatHelper (Location loc, Value arg, Value min, Value max, OpBuilder &rewriter)
 
Value clampIntHelper (Location loc, Value arg, Value min, Value max, OpBuilder &rewriter, bool isUnsigned)
 
bool validIntegerRange (IntegerType ty, int64_t value)
 
template<typename Op >
std::optional< SmallVector< Value > > checkHasDynamicBatchDims (PatternRewriter &rewriter, Op op, ArrayRef< Value > params)
 
LogicalResult EqualizeRanks (PatternRewriter &rewriter, Location loc, Value &input1, Value &input2)
 Common code to create the reshape op where necessary to make the rank of two values equal. More...
 
LogicalResult EqualizeRanks (ImplicitLocOpBuilder &builder, Value &input1, Value &input2)
 
template<typename TosaOp , typename... Args>
TosaOp CreateOpAndInferShape (ImplicitLocOpBuilder &builder, Type resultTy, Args &&...args)
 
template<typename TosaOp , typename... Args>
TosaOp CreateOpAndInferShape (PatternRewriter &rewriter, Location loc, Type resultTy, Args &&...args)
 
template<typename T >
SmallVector< T > applyTOSAPermutation (ArrayRef< T > input, ArrayRef< int32_t > perms)
 
Value getTosaConstShape (ImplicitLocOpBuilder &builder, llvm::ArrayRef< int64_t > shape)
 
Value getTosaConstShape (PatternRewriter &rewriter, Location loc, llvm::ArrayRef< int64_t > shape)
 
SmallVector< int64_t > convertFromMlirShape (ArrayRef< int64_t > shape)
 
bool getConstShapeValue (Operation *op, llvm::SmallVector< int64_t > &result_shape)
 
void computeMultiplierAndShift (double scale, int32_t &multiplier, int32_t &shift, int32_t scaleWidth)
 From a scale value, computes multiplier and shift values for 16 or 32-bit scale widths. More...
 
ConvOpQuantizationAttr buildConvOpQuantizationAttr (OpBuilder &builder, Value input, Value weight)
 Method to build ConvOpQuantizationAttr, called from ConvOpQuantInfoBuilder/TransConvOpQuantInfoBuilder: input_zp: input zeropoint weight_zp: weight zeropoint. More...
 
std::pair< Value, ValuecreateZPsAsConst (OpBuilder &builder, Value input, Value weight)
 
MatMulOpQuantizationAttr buildMatMulOpQuantizationAttr (OpBuilder &builder, Value a, Value b)
 Builds MatMulOpQuantizationAttr, called from MatMulOpQuantInfoBuilder: aZp: input a zeropoint bZp: input b zeropoint. More...
 
UnaryOpQuantizationAttr buildUnaryOpQuantizationAttr (OpBuilder &builder, Value input, Type outputRawType)
 Builds UnaryOpQuantizationAttr UnaryOpQuantInfoBuilder: inputZp: input zeropoint outputZp: output zeropoint. More...
 
PadOpQuantizationAttr buildPadOpQuantizationAttr (OpBuilder &builder, Value input)
 Builds PadOpQuantizationAttr, called from PadOpQuantInfoBuilder: inputZp: input zeropoint. More...
 
Type buildConvOpResultTypeInfo (OpBuilder &builder, Type outputType, Value input, Value weight)
 construct ConvOp output type with correct bitwidth based on input/weight width. More...
 
Type buildQTypeFromMinMax (OpBuilder builder, Type inputDType, Attribute minAttr, Attribute maxAttr, IntegerAttr quantBits, int filterQuantDim, bool isSigned, BoolAttr narrowRange)
 Builds Tosa quantization attributes from min/max values. More...
 
TypeAttr buildQTypeAttrFromMinMax (OpBuilder builder, Type inputDType, Attribute minAttr, Attribute maxAttr, IntegerAttr quantBits, int filterQuantDim, bool isSigned, BoolAttr narrowRange)
 Builds Tosa quantization attributes from min/max values. More...
 

Variables

template<typename Op >
constexpr bool is_tosa_conv_v = IsTosaConv<Op>::value
 

Typedef Documentation

◆ FailOrMaybeZP

using mlir::tosa::FailOrMaybeZP = typedef llvm::FailureOr<std::optional<ConvZpPair> >

Definition at line 226 of file TosaOps.h.

Function Documentation

◆ addTosaToLinalgPasses()

void mlir::tosa::addTosaToLinalgPasses ( OpPassManager pm,
const TosaToLinalgOptions &  options,
const TosaToLinalgNamedOptions &  tosaToLinalgNamedOptions = TosaToLinalgNamedOptions(),
std::optional< tosa::TosaValidationOptions >  validationOptions = tosa::TosaValidationOptions{ {"none"}, false, tosa::TosaLevelEnum::None} 
)

Populates passes to convert from TOSA to Linalg on buffers.

At the end of the pass, the function will only contain linalg ops or standard ops if the pipeline succeeds. The option to disable decompositions is available for benchmarking performance improvements from the canonicalizations.

Definition at line 82 of file TosaToLinalgPass.cpp.

References mlir::OpPassManager::addNestedPass(), mlir::OpPassManager::addPass(), mlir::createCanonicalizerPass(), createTosaInferShapesPass(), createTosaLayerwiseConstantFoldPass(), createTosaMakeBroadcastablePass(), createTosaOptionalDecompositions(), createTosaToLinalg(), createTosaToLinalgNamed(), and options.

Referenced by registerTosaToLinalgPipelines().

◆ addTosaToSCFPasses()

void mlir::tosa::addTosaToSCFPasses ( OpPassManager pm)

Populates passes to convert from TOSA to SCF.

Definition at line 55 of file TosaToSCFPass.cpp.

References mlir::OpPassManager::addNestedPass(), and createTosaToSCF().

◆ applyTOSAPermutation()

template<typename T >
SmallVector<T> mlir::tosa::applyTOSAPermutation ( ArrayRef< T >  input,
ArrayRef< int32_t >  perms 
)

Definition at line 222 of file ConversionUtils.h.

◆ buildConvOpQuantizationAttr()

ConvOpQuantizationAttr mlir::tosa::buildConvOpQuantizationAttr ( OpBuilder builder,
Value  input,
Value  weight 
)

Method to build ConvOpQuantizationAttr, called from ConvOpQuantInfoBuilder/TransConvOpQuantInfoBuilder: input_zp: input zeropoint weight_zp: weight zeropoint.

Definition at line 191 of file QuantUtils.cpp.

References mlir::Builder::getAttr(), and getConvZeroPoints().

Referenced by buildConvOpWithQuantInfo(), buildFCOpWithQuantInfo(), and buildTransConvOpWithQuantInfo().

◆ buildConvOpResultTypeInfo()

Type mlir::tosa::buildConvOpResultTypeInfo ( OpBuilder builder,
Type  outputType,
Value  input,
Value  weight 
)

construct ConvOp output type with correct bitwidth based on input/weight width.

Builds output type for a quantized ConvOp with the right bitwidth.

This is called by the builder when dealing with quantized content.

Definition at line 282 of file QuantUtils.cpp.

References GET_QTYPE, mlir::Builder::getI32Type(), mlir::Builder::getIntegerType(), and mlir::Value::getType().

Referenced by buildConvOpWithQuantInfo(), buildFCOpWithQuantInfo(), and buildTransConvOpWithQuantInfo().

◆ buildMatMulOpQuantizationAttr()

MatMulOpQuantizationAttr mlir::tosa::buildMatMulOpQuantizationAttr ( OpBuilder builder,
Value  a,
Value  b 
)

Builds MatMulOpQuantizationAttr, called from MatMulOpQuantInfoBuilder: aZp: input a zeropoint bZp: input b zeropoint.

Definition at line 207 of file QuantUtils.cpp.

References GET_UQTYPE, mlir::Builder::getAttr(), and mlir::Value::getType().

Referenced by buildMatMulOpWithQuantInfo().

◆ buildPadOpQuantizationAttr()

PadOpQuantizationAttr mlir::tosa::buildPadOpQuantizationAttr ( OpBuilder builder,
Value  input 
)

Builds PadOpQuantizationAttr, called from PadOpQuantInfoBuilder: inputZp: input zeropoint.

Definition at line 262 of file QuantUtils.cpp.

References GET_UQTYPE, mlir::Builder::getAttr(), and mlir::Value::getType().

Referenced by buildExplicitValuePadOpWithQuantInfo(), and buildPadOpWithQuantInfo().

◆ buildQTypeAttrFromMinMax()

TypeAttr mlir::tosa::buildQTypeAttrFromMinMax ( OpBuilder  builder,
Type  inputDType,
Attribute  minAttr,
Attribute  maxAttr,
IntegerAttr  quantBits,
int  filterQuantDim,
bool  isSigned,
BoolAttr  narrowRange 
)

Builds Tosa quantization attributes from min/max values.

Definition at line 382 of file QuantUtils.cpp.

References buildQTypeFromMinMax(), and mlir::get().

◆ buildQTypeFromMinMax()

Type mlir::tosa::buildQTypeFromMinMax ( OpBuilder  builder,
Type  inputDType,
Attribute  minAttr,
Attribute  maxAttr,
IntegerAttr  quantBits,
int  filterQuantDim,
bool  isSigned,
BoolAttr  narrowRange 
)

◆ buildUnaryOpQuantizationAttr()

UnaryOpQuantizationAttr mlir::tosa::buildUnaryOpQuantizationAttr ( OpBuilder builder,
Value  input,
Type  outputRawType 
)

Builds UnaryOpQuantizationAttr UnaryOpQuantInfoBuilder: inputZp: input zeropoint outputZp: output zeropoint.

Definition at line 236 of file QuantUtils.cpp.

References GET_UQTYPE, mlir::Builder::getAttr(), and mlir::Value::getType().

Referenced by buildAvgPool2dOpWithQuantInfo(), and buildUnaryOpWithQuantInfo().

◆ checkHasDynamicBatchDims()

template<typename Op >
std::optional<SmallVector<Value> > mlir::tosa::checkHasDynamicBatchDims ( PatternRewriter rewriter,
Op  op,
ArrayRef< Value params 
)

◆ clampFloatHelper()

Value mlir::tosa::clampFloatHelper ( Location  loc,
Value  arg,
Value  min,
Value  max,
OpBuilder rewriter 
)

Definition at line 34 of file ConversionUtils.cpp.

References mlir::OpBuilder::create(), max(), and min().

Referenced by createLinalgBodyCalculationForElementwiseOp().

◆ clampIntHelper()

Value mlir::tosa::clampIntHelper ( Location  loc,
Value  arg,
Value  min,
Value  max,
OpBuilder rewriter,
bool  isUnsigned 
)

Definition at line 40 of file ConversionUtils.cpp.

References mlir::OpBuilder::create(), max(), and min().

Referenced by createLinalgBodyCalculationForElementwiseOp().

◆ computeMultiplierAndShift()

void mlir::tosa::computeMultiplierAndShift ( double  scale,
int32_t &  multiplier,
int32_t &  shift,
int32_t  scaleWidth 
)

From a scale value, computes multiplier and shift values for 16 or 32-bit scale widths.

Generates a quantized multiplier/shift from double.

Definition at line 95 of file QuantUtils.cpp.

References computeMultiplierAndShiftTosaScale16(), and computeMultiplierAndShiftTosaScale32().

◆ condenseValues()

SmallVector< Value > mlir::tosa::condenseValues ( const SmallVector< Value > &  values)

Definition at line 26 of file ConversionUtils.cpp.

Referenced by inferDynamicDimsForConv().

◆ convertFromMlirShape()

SmallVector< int64_t > mlir::tosa::convertFromMlirShape ( ArrayRef< int64_t >  shape)

Definition at line 178 of file ConversionUtils.cpp.

Referenced by getTosaConstShape().

◆ CreateOpAndInferShape() [1/2]

template<typename TosaOp , typename... Args>
TosaOp mlir::tosa::CreateOpAndInferShape ( ImplicitLocOpBuilder builder,
Type  resultTy,
Args &&...  args 
)

Definition at line 146 of file ConversionUtils.h.

References EqualizeRanks(), and mlir::presburger::round().

◆ CreateOpAndInferShape() [2/2]

template<typename TosaOp , typename... Args>
TosaOp mlir::tosa::CreateOpAndInferShape ( PatternRewriter rewriter,
Location  loc,
Type  resultTy,
Args &&...  args 
)

Definition at line 213 of file ConversionUtils.h.

◆ createTosaInferShapesPass()

std::unique_ptr< Pass > mlir::tosa::createTosaInferShapesPass ( )

Definition at line 349 of file TosaInferShapes.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaLayerwiseConstantFoldPass() [1/2]

std::unique_ptr< Pass > mlir::tosa::createTosaLayerwiseConstantFoldPass ( )

Definition at line 70 of file TosaLayerwiseConstantFoldPass.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaLayerwiseConstantFoldPass() [2/2]

std::unique_ptr< Pass > mlir::tosa::createTosaLayerwiseConstantFoldPass ( const TosaLayerwiseConstantFoldPassOptions &  options)

Definition at line 75 of file TosaLayerwiseConstantFoldPass.cpp.

References options.

◆ createTosaMakeBroadcastablePass()

std::unique_ptr< Pass > mlir::tosa::createTosaMakeBroadcastablePass ( )

Definition at line 254 of file TosaMakeBroadcastable.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaOptionalDecompositions()

std::unique_ptr< Pass > mlir::tosa::createTosaOptionalDecompositions ( )

Definition at line 52 of file TosaOptionalDecompositions.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaTestQuantUtilAPIPass()

std::unique_ptr<Pass> mlir::tosa::createTosaTestQuantUtilAPIPass ( )

◆ createTosaToArith()

std::unique_ptr< Pass > mlir::tosa::createTosaToArith ( bool  includeApplyRescale = false,
bool  use32BitApplyRescale = false 
)

Definition at line 57 of file TosaToArithPass.cpp.

References options.

◆ createTosaToLinalg()

std::unique_ptr< Pass > mlir::tosa::createTosaToLinalg ( )

Definition at line 78 of file TosaToLinalgPass.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaToLinalgNamed()

std::unique_ptr< Pass > mlir::tosa::createTosaToLinalgNamed ( const TosaToLinalgNamedOptions &  options = TosaToLinalgNamedOptions())

Definition at line 82 of file TosaToLinalgNamedPass.cpp.

References options.

Referenced by addTosaToLinalgPasses().

◆ createTosaToSCF()

std::unique_ptr< Pass > mlir::tosa::createTosaToSCF ( )

Definition at line 51 of file TosaToSCFPass.cpp.

Referenced by addTosaToSCFPasses().

◆ createTosaToTensor()

std::unique_ptr< Pass > mlir::tosa::createTosaToTensor ( )

Definition at line 57 of file TosaToTensorPass.cpp.

◆ createZeroPointTensor()

std::optional< Value > mlir::tosa::createZeroPointTensor ( OpBuilder builder,
Location  loc,
Type  srcElemType,
int64_t  zp = 0 
)

◆ createZPsAsConst()

std::pair< Value, Value > mlir::tosa::createZPsAsConst ( OpBuilder builder,
Value  input,
Value  weight 
)

◆ EqualizeRanks() [1/2]

LogicalResult mlir::tosa::EqualizeRanks ( ImplicitLocOpBuilder builder,
Value input1,
Value input2 
)

◆ EqualizeRanks() [2/2]

LogicalResult mlir::tosa::EqualizeRanks ( PatternRewriter rewriter,
Location  loc,
Value input1,
Value input2 
)

Common code to create the reshape op where necessary to make the rank of two values equal.

input1 and input2 will be updated when the rank has changed. The caller is expected to use these to rewrite the original operator with the RESHAPE now in the graph.

Definition at line 103 of file ConversionUtils.cpp.

Referenced by CreateOpAndInferShape().

◆ extractConvZpPair()

template<typename TosaConvOp >
std::enable_if_t<is_tosa_conv_v<TosaConvOp>, FailOrMaybeZP> mlir::tosa::extractConvZpPair ( TosaConvOp  op,
PatternRewriter rewriter 
)

◆ getConstShapeValue()

bool mlir::tosa::getConstShapeValue ( Operation op,
llvm::SmallVector< int64_t > &  result_shape 
)

◆ getNParallelLoopsAttrs()

SmallVector< utils::IteratorType > mlir::tosa::getNParallelLoopsAttrs ( unsigned  nParallelLoops)

◆ getTosaConstShape() [1/2]

Value mlir::tosa::getTosaConstShape ( ImplicitLocOpBuilder builder,
llvm::ArrayRef< int64_t >  shape 
)

◆ getTosaConstShape() [2/2]

Value mlir::tosa::getTosaConstShape ( PatternRewriter rewriter,
Location  loc,
llvm::ArrayRef< int64_t >  shape 
)

Definition at line 172 of file ConversionUtils.cpp.

References getTosaConstShape().

◆ getZeroPoint()

LogicalResult mlir::tosa::getZeroPoint ( ElementsAttr  zpAttr,
int64_t &  zp 
)

Definition at line 2502 of file TosaOps.cpp.

Referenced by extractConvZpPair(), and verifyConvOp().

◆ isa_tosa_shape_type()

bool mlir::tosa::isa_tosa_shape_type ( mlir::Type  t)

Definition at line 2551 of file TosaOps.cpp.

◆ parseTypeOrAttr()

ParseResult mlir::tosa::parseTypeOrAttr ( OpAsmParser parser,
TypeAttr &  typeAttr,
Attribute attr 
)

◆ populateTosaConstantReduction()

void mlir::tosa::populateTosaConstantReduction ( MLIRContext ctx,
RewritePatternSet patterns,
bool  aggressiveReduceConstant 
)

Definition at line 405 of file TosaFolders.cpp.

References mlir::patterns.

◆ populateTosaDecomposeConv2D()

void mlir::tosa::populateTosaDecomposeConv2D ( MLIRContext ctx,
RewritePatternSet patterns 
)

Definition at line 158 of file TosaDecomposeConv2D.cpp.

References mlir::patterns.

◆ populateTosaDecomposeDepthwise()

void mlir::tosa::populateTosaDecomposeDepthwise ( MLIRContext ctx,
RewritePatternSet patterns 
)

Definition at line 177 of file TosaDecomposeDepthwise.cpp.

References mlir::patterns.

◆ populateTosaDecomposeTransposeConv()

void mlir::tosa::populateTosaDecomposeTransposeConv ( MLIRContext ctx,
RewritePatternSet patterns 
)

Definition at line 342 of file TosaDecomposeTransposeConv.cpp.

References mlir::patterns.

◆ populateTosaFoldConstantReciprocalPatterns()

void mlir::tosa::populateTosaFoldConstantReciprocalPatterns ( MLIRContext ctx,
RewritePatternSet patterns 
)

Definition at line 427 of file TosaFolders.cpp.

References mlir::patterns.

◆ populateTosaFoldConstantTransposePatterns()

void mlir::tosa::populateTosaFoldConstantTransposePatterns ( MLIRContext ctx,
RewritePatternSet patterns 
)

Definition at line 422 of file TosaFolders.cpp.

References mlir::patterns.

◆ populateTosaRescaleToArithConversionPatterns()

void mlir::tosa::populateTosaRescaleToArithConversionPatterns ( RewritePatternSet patterns,
bool  include32Bit = false 
)

Definition at line 246 of file TosaToArith.cpp.

References mlir::patterns.

◆ populateTosaToArithConversionPatterns()

void mlir::tosa::populateTosaToArithConversionPatterns ( RewritePatternSet patterns)

Definition at line 241 of file TosaToArith.cpp.

References mlir::patterns.

◆ populateTosaToLinalgConversionPatterns()

void mlir::tosa::populateTosaToLinalgConversionPatterns ( const TypeConverter converter,
RewritePatternSet patterns 
)

Populates conversion passes from TOSA dialect to Linalg dialect.

Definition at line 2612 of file TosaToLinalg.cpp.

References mlir::patterns.

◆ populateTosaToLinalgNamedConversionPatterns()

void mlir::tosa::populateTosaToLinalgNamedConversionPatterns ( const TypeConverter converter,
RewritePatternSet patterns,
const TosaToLinalgNamedOptions &  options 
)

Populates conversion passes from TOSA dialect to Linalg named operations.

Definition at line 1075 of file TosaToLinalgNamed.cpp.

References options, and mlir::patterns.

◆ populateTosaToMLProgramConversionPatterns()

void mlir::tosa::populateTosaToMLProgramConversionPatterns ( RewritePatternSet patterns)

Definition at line 72 of file TosaToMLProgram.cpp.

References mlir::patterns.

◆ populateTosaToSCFConversionPatterns()

void mlir::tosa::populateTosaToSCFConversionPatterns ( RewritePatternSet patterns)

Definition at line 176 of file TosaToSCF.cpp.

References mlir::patterns.

◆ populateTosaToTensorConversionPatterns()

void mlir::tosa::populateTosaToTensorConversionPatterns ( const TypeConverter converter,
RewritePatternSet patterns 
)

Definition at line 469 of file TosaToTensor.cpp.

References mlir::patterns.

◆ populateTosaTypeConversion()

void mlir::tosa::populateTosaTypeConversion ( TypeConverter converter)

◆ printTypeOrAttr()

void mlir::tosa::printTypeOrAttr ( OpAsmPrinter p,
Operation op,
TypeAttr  type,
Attribute  attr 
)

Definition at line 197 of file TosaOps.cpp.

References mlir::AsmPrinter::printAttribute().

◆ registerShardingInterfaceExternalModels()

void mlir::tosa::registerShardingInterfaceExternalModels ( DialectRegistry registry)

◆ registerTosaToLinalgPipelines()

void mlir::tosa::registerTosaToLinalgPipelines ( )

Populates TOSA to linalg pipelines Currently, this includes only the "tosa-to-linalg-pipeline".

Definition at line 109 of file TosaToLinalgPass.cpp.

References addTosaToLinalgPasses().

Referenced by mlir::registerAllPasses().

◆ validIntegerRange()

bool mlir::tosa::validIntegerRange ( IntegerType  ty,
int64_t  value 
)

Definition at line 50 of file ConversionUtils.cpp.

◆ verifyZeroPoint()

template<typename T >
LogicalResult mlir::tosa::verifyZeroPoint ( Type  zpElemType,
int64_t  zp 
)

Variable Documentation

◆ is_tosa_conv_v

template<typename Op >
constexpr bool mlir::tosa::is_tosa_conv_v = IsTosaConv<Op>::value
constexpr

Definition at line 205 of file TosaOps.h.