MLIR 24.0.0git
mlir::tosa Namespace Reference

Namespaces

namespace  detail
 Implemented by ops that correspond to the Tosa specification.
namespace  impl

Classes

struct  MatMulTOperands
struct  OpComplianceInfo
class  ProfileInfoDepot
class  TargetEnv
 This class represents the capability enabled in the target implementation such as profile, extension, and level. More...
struct  TosaAttachTargetOptions
struct  TosaInferShapesPassOptions
struct  TosaInputShapeOptions
struct  TosaLayerwiseConstantFoldPassOptions
struct  TosaLevel
struct  TosaNarrowF32ToF16PassOptions
struct  TosaNarrowF64ToF32PassOptions
struct  TosaNarrowI64ToI32PassOptions
class  TosaOp
class  TosaProfileCompliance
class  TosaSpecificationVersion
 A thin wrapper around the SpecificationVersion enum to represent and provide utilities around the TOSA specification version. More...
struct  TosaValidationOptions
struct  TypeInfo
struct  TypeInfoRef
struct  ValueKnowledge
 Statically known information for a particular Value. More...
struct  VersionedTypeInfo

Typedefs

using OperationProfileComplianceMap
using OperationExtensionComplianceMap

Enumerations

enum  CheckCondition { invalid , anyOf , allOf }

Functions

void populateTosaToArithConversionPatterns (RewritePatternSet *patterns)
void populateTosaRescaleToArithConversionPatterns (RewritePatternSet *patterns, bool include32Bit=false)
std::unique_ptr< Pass > createTosaToLinalg (const TosaToLinalgOptions &options=TosaToLinalgOptions())
std::unique_ptr< Pass > createTosaToLinalgNamed (const TosaToLinalgNamedOptions &options=TosaToLinalgNamedOptions())
void addTosaToLinalgPasses (OpPassManager &pm, const TosaToLinalgOptions &options, const TosaToLinalgNamedOptions &tosaToLinalgNamedOptions=TosaToLinalgNamedOptions(), std::optional< tosa::TosaValidationOptions > validationOptions=tosa::TosaValidationOptions{false, false}, std::optional< TosaAttachTargetOptions > attachTargetOptions=std::nullopt)
 Populates passes to convert from TOSA to Linalg.
void registerTosaToLinalgPipelines ()
 Populates TOSA to linalg pipelines Currently, this includes only the "tosa-to-linalg-pipeline".
void populateTosaToLinalgConversionPatterns (const TypeConverter &converter, RewritePatternSet *patterns, const TosaToLinalgOptions &options=TosaToLinalgOptions())
 Populates conversion passes from TOSA dialect to Linalg dialect.
void populateTosaToLinalgNamedConversionPatterns (const TypeConverter &converter, RewritePatternSet *patterns, const TosaToLinalgNamedOptions &options)
 Populates conversion passes from TOSA dialect to Linalg named operations.
void populateTosaToMLProgramConversionPatterns (RewritePatternSet *patterns)
void populateTosaToSCFConversionPatterns (RewritePatternSet *patterns)
void addTosaToSCFPasses (OpPassManager &pm)
 Populates passes to convert from TOSA to SCF.
std::unique_ptr< Pass > createTosaToSPIRVTosaMarkGraphConstants ()
std::unique_ptr< Pass > createTosaToSPIRVTosa ()
spirv::VerCapExtAttr getDefaultVerCapExtAttr (MLIRContext *context)
spirv::TargetEnvAttr constructTargetEnvAttrWithCapExtDefaults (MLIRContext *context, spirv::ResourceLimitsAttr limits={}, spirv::ClientAPI clientAPI=spirv::ClientAPI::Unknown, spirv::Vendor vendorID=spirv::Vendor::Unknown, spirv::DeviceType deviceType=spirv::DeviceType::Unknown, uint32_t deviceID=spirv::TargetEnvAttr::kUnknownDeviceID)
void populateTosaToSPIRVTosaConversionPatterns (SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns, spirv::TargetEnvAttr targetAttr)
void populateTosaToSPIRVTosaOpsConversionPatterns (SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
void populateTosaToSPIRVTosaCustomConversionPatterns (SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns, llvm::StringMap< int32_t > domainToOpcode)
void populateTosaToTensorConversionPatterns (const TypeConverter &converter, RewritePatternSet *patterns)
void registerShardingInterfaceExternalModels (DialectRegistry &registry)
TosaLevel getTosaLevelFromEnum (const Level level)
TargetEnvAttr lookupTargetEnv (Operation *op)
TargetEnvAttr getDefaultTargetEnv (MLIRContext *context)
TargetEnvAttr lookupTargetEnvOrDefault (Operation *op)
 Queries the target environment recursively from enclosing symbol table ops containing the given op or returns the default target environment as returned by getDefaultTargetEnv() if not provided.
TosaSpecificationVersion getMinVersion (const Profile &profile)
TosaSpecificationVersion getMinVersion (const Extension &extension)
TosaSpecificationVersion getMinVersion (const Level &level)
llvm::SmallString< 4 > stringifyVersion (TosaSpecificationVersion version)
ParseResult parseVariableOpTypeOrInitialValue (OpAsmParser &parser, DenseElementsAttr &varShapeAttr, TypeAttr &typeAttr, Attribute &initialValueAttr)
void printVariableOpTypeOrInitialValue (OpAsmPrinter &p, Operation *op, DenseElementsAttr varShapeAttr, TypeAttr typeAttr, Attribute initialValueAttr)
bool isa_tosa_shape_type (mlir::Type t)
std::optional< Value > createZeroPointTensor (OpBuilder &builder, Location loc, Type srcElemType, int64_t zp=0)
Value createPadConstTensor (OpBuilder &builder, Location loc, Value src, int32_t val=0)
RankedTensorType getVariableType (VariableOp variableOp)
unsigned getBitWidth (Type type)
Type getStorageElementTypeOrSelf (Type type)
Type getStorageElementTypeOrSelf (Value value)
LogicalResult verifyBlockScaledTensorType (mlir::Type type, llvm::function_ref< mlir::InFlightDiagnostic()> emitError=nullptr, bool allowScaleValues=false)
std::string getTosaTensorTypeErrorMessage (mlir::Type type)
std::unique_ptr<::mlir::Pass > createTosaArithConstantToTosaConstPass ()
std::unique_ptr<::mlir::Pass > createTosaAttachTarget ()
std::unique_ptr<::mlir::Pass > createTosaAttachTarget (TosaAttachTargetOptions options)
std::unique_ptr<::mlir::Pass > createTosaConvertIntegerTypeToSignless ()
std::unique_ptr<::mlir::Pass > createTosaDowngrade1p1To1p0Pass ()
std::unique_ptr<::mlir::Pass > createTosaGatherScatterHardeningPass ()
std::unique_ptr<::mlir::Pass > createTosaInferShapesPass ()
std::unique_ptr<::mlir::Pass > createTosaInferShapesPass (TosaInferShapesPassOptions options)
std::unique_ptr<::mlir::Pass > createTosaLayerwiseConstantFoldPass ()
std::unique_ptr<::mlir::Pass > createTosaLayerwiseConstantFoldPass (TosaLayerwiseConstantFoldPassOptions options)
std::unique_ptr<::mlir::Pass > createTosaMakeBroadcastablePass ()
std::unique_ptr<::mlir::Pass > createTosaNarrowF32ToF16Pass ()
std::unique_ptr<::mlir::Pass > createTosaNarrowF32ToF16Pass (TosaNarrowF32ToF16PassOptions options)
std::unique_ptr<::mlir::Pass > createTosaNarrowF64ToF32Pass ()
std::unique_ptr<::mlir::Pass > createTosaNarrowF64ToF32Pass (TosaNarrowF64ToF32PassOptions options)
std::unique_ptr<::mlir::Pass > createTosaNarrowI64ToI32Pass ()
std::unique_ptr<::mlir::Pass > createTosaNarrowI64ToI32Pass (TosaNarrowI64ToI32PassOptions options)
std::unique_ptr<::mlir::Pass > createTosaOptionalDecompositionsPass ()
std::unique_ptr<::mlir::Pass > createTosaReduceTransposes ()
std::unique_ptr<::mlir::Pass > createTosaValidation ()
std::unique_ptr<::mlir::Pass > createTosaValidation (TosaValidationOptions options)
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< Pass > createTosaTestQuantUtilAPIPass ()
std::unique_ptr< Pass > createTosaInputShapePass (std::vector< std::string > args={})
void registerTosaArithConstantToTosaConstPass ()
void registerTosaArithConstantToTosaConstPassPass ()
void registerTosaAttachTarget ()
void registerTosaAttachTargetPass ()
void registerTosaConvertIntegerTypeToSignless ()
void registerTosaConvertIntegerTypeToSignlessPass ()
void registerTosaDowngrade1p1To1p0Pass ()
void registerTosaDowngrade1p1To1p0PassPass ()
void registerTosaGatherScatterHardeningPass ()
void registerTosaGatherScatterHardeningPassPass ()
void registerTosaInferShapesPass ()
void registerTosaInferShapesPassPass ()
void registerTosaInputShape ()
void registerTosaInputShapePass ()
void registerTosaLayerwiseConstantFoldPass ()
void registerTosaLayerwiseConstantFoldPassPass ()
void registerTosaMakeBroadcastablePass ()
void registerTosaMakeBroadcastablePassPass ()
void registerTosaNarrowF32ToF16Pass ()
void registerTosaNarrowF32ToF16PassPass ()
void registerTosaNarrowF64ToF32Pass ()
void registerTosaNarrowF64ToF32PassPass ()
void registerTosaNarrowI64ToI32Pass ()
void registerTosaNarrowI64ToI32PassPass ()
void registerTosaOptionalDecompositionsPass ()
void registerTosaOptionalDecompositionsPassPass ()
void registerTosaReduceTransposes ()
void registerTosaReduceTransposesPass ()
void registerTosaValidation ()
void registerTosaValidationPass ()
void registerTosaPasses ()
SmallVector< utils::IteratorType > getNParallelLoopsAttrs (unsigned nParallelLoops)
SmallVector< Value > condenseValues (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)
APFloat getFloatMinMaxIdentity (const llvm::fltSemantics &semantics, bool negative, bool allowNonFinites)
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.
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 (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 getConstShapeValues (Operation *op, llvm::SmallVector< int64_t > &result_shape)
SmallVector< int64_t > convertFromIntAttr (const DenseElementsAttr &attr, const int rank)
bool hasUniqueConstantScatterIndices (ShapedType indicesType, DenseIntElementsAttr indicesAttr)
template<typename T>
std::optional< ArrayRef< T > > tryGetDenseResourceValues (ElementsAttr attr)
template<typename T>
FailureOr< T > getConstantScalarIntValue (Value val)
bool 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.
template<typename IntType>
Value getConstTensorInt (OpBuilder &builder, Location loc, ArrayRef< IntType > vec)
ConvOpQuantizationAttr buildConvOpQuantizationAttr (OpBuilder &builder, Value input, Value weight)
 Method to build ConvOpQuantizationAttr, called from ConvOpQuantInfoBuilder/TransConvOpQuantInfoBuilder: input_zp: input zeropoint weight_zp: weight zeropoint.
std::pair< Value, Value > createZPsAsConst (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.
UnaryOpQuantizationAttr buildUnaryOpQuantizationAttr (OpBuilder &builder, Value input, Type outputRawType)
 Builds UnaryOpQuantizationAttr UnaryOpQuantInfoBuilder: inputZp: input zeropoint outputZp: output zeropoint.
PadOpQuantizationAttr buildPadOpQuantizationAttr (OpBuilder &builder, Value input)
 Builds PadOpQuantizationAttr, called from PadOpQuantInfoBuilder: inputZp: input zeropoint.
Type buildConvOpResultTypeInfo (OpBuilder &builder, Type outputType, Value input, Value weight)
 construct ConvOp output type with correct bitwidth based on input/weight width.
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.
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.
Type getStorageElementTypeFromQuantized (quant::QuantizedType quantizedType)
MatMulTOperands prepareMatMulTOperands (PatternRewriter &rewriter, Location loc, Value a, Value b, RankedTensorType outputType)
 Broadcast the batch dimensions of the ranked operands and create a zero-filled result tensor for either MATMUL_T lowering pattern.
SmallVector< Profile, 2 > getCooperativeProfiles (Extension ext)

Variables

constexpr llvm::StringLiteral graphARMInterfaceVarABIAttrName
constexpr llvm::StringLiteral graphARMGraphConstantIdAttrName
static constexpr TosaLevel TOSA_LEVEL_EIGHTK
static constexpr TosaLevel TOSA_LEVEL_NONE
constexpr int64_t kInferableDimSize = -1
 Represents a dimension in the shape of a tensor that can be inferred based on the other provided dimensions.

Typedef Documentation

◆ OperationExtensionComplianceMap

Initial value:
std::unordered_map<std::string, SmallVector<OpComplianceInfo<Extension>>>

Definition at line 98 of file TosaProfileCompliance.h.

◆ OperationProfileComplianceMap

Initial value:
std::unordered_map<std::string, SmallVector<OpComplianceInfo<Profile>>>

Definition at line 96 of file TosaProfileCompliance.h.

Enumeration Type Documentation

◆ CheckCondition

Enumerator
invalid 
anyOf 
allOf 

Definition at line 43 of file TosaProfileCompliance.h.

Function Documentation

◆ addTosaToLinalgPasses()

void mlir::tosa::addTosaToLinalgPasses ( OpPassManager & pm,
const TosaToLinalgOptions & options,
const TosaToLinalgNamedOptions & tosaToLinalgNamedOptions = TosaToLinalgNamedOptions(),
std::optional< tosa::TosaValidationOptions > validationOptions = tosa::TosaValidationOptions{false, false},
std::optional< TosaAttachTargetOptions > attachTargetOptions = std::nullopt )

Populates passes to convert from TOSA to Linalg.

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 89 of file TosaToLinalgPass.cpp.

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

Referenced by registerTosaToLinalgPipelines().

◆ addTosaToSCFPasses()

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

Populates passes to convert from TOSA to SCF.

Definition at line 49 of file TosaToSCFPass.cpp.

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

◆ applyTOSAPermutation()

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

Definition at line 231 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 202 of file QuantUtils.cpp.

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

Referenced by buildConvOpWithQuantInfo(), 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 293 of file QuantUtils.cpp.

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

Referenced by buildConvOpWithQuantInfo(), 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 218 of file QuantUtils.cpp.

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

Referenced by buildMatMulLikeOpWithQuantInfo().

◆ buildPadOpQuantizationAttr()

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

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

Definition at line 273 of file QuantUtils.cpp.

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

Referenced by 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 393 of file QuantUtils.cpp.

References buildQTypeFromMinMax().

◆ 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 247 of file QuantUtils.cpp.

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

Referenced by buildAvgPool2dAdaptiveOpWithQuantInfo(), buildAvgPool2dOpWithQuantInfo(), and buildNegateOpWithQuantInfo().

◆ 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 35 of file ConversionUtils.cpp.

References 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 41 of file ConversionUtils.cpp.

References max(), and min().

Referenced by createLinalgBodyCalculationForElementwiseOp().

◆ computeMultiplierAndShift()

bool 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 27 of file ConversionUtils.cpp.

Referenced by inferDynamicDimsForConv(), and prepareMatMulTOperands().

◆ constructTargetEnvAttrWithCapExtDefaults()

spirv::TargetEnvAttr mlir::tosa::constructTargetEnvAttrWithCapExtDefaults ( MLIRContext * context,
spirv::ResourceLimitsAttr limits = {},
spirv::ClientAPI clientAPI = spirv::ClientAPI::Unknown,
spirv::Vendor vendorID = spirv::Vendor::Unknown,
spirv::DeviceType deviceType = spirv::DeviceType::Unknown,
uint32_t deviceID = spirv::TargetEnvAttr::kUnknownDeviceID )

◆ convertFromIntAttr()

SmallVector< int64_t > mlir::tosa::convertFromIntAttr ( const DenseElementsAttr & attr,
const int rank )

◆ convertFromMlirShape()

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

Definition at line 191 of file ConversionUtils.cpp.

Referenced by buildVariableOp(), and getTosaConstShape().

◆ CreateOpAndInferShape() [1/2]

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

Definition at line 155 of file ConversionUtils.h.

References createOpAndInferShape(), and EqualizeRanks().

Referenced by CreateOpAndInferShape().

◆ CreateOpAndInferShape() [2/2]

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

Definition at line 222 of file ConversionUtils.h.

References CreateOpAndInferShape().

◆ createOpAndInferShape()

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

◆ createPadConstTensor()

Value mlir::tosa::createPadConstTensor ( OpBuilder & builder,
Location loc,
Value src,
int32_t val = 0 )

◆ createTosaArithConstantToTosaConstPass()

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

We declare an explicit private instantiation because Pass classes should only be visible by the current library.

Definition at line 93 of file TosaArithConstantToConst.cpp.

References mlir::RewritePatternSet::add(), mlir::applyPatternsGreedily(), getContext(), and mlir::DialectRegistry::insert().

◆ createTosaAttachTarget() [1/2]

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

Definition at line 204 of file TosaAttachTarget.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaAttachTarget() [2/2]

std::unique_ptr<::mlir::Pass > mlir::tosa::createTosaAttachTarget ( TosaAttachTargetOptions options)

Definition at line 208 of file TosaAttachTarget.cpp.

◆ createTosaConvertIntegerTypeToSignless()

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

We declare an explicit private instantiation because Pass classes should only be visible by the current library.

Definition at line 283 of file TosaConvertIntegerTypeToSignless.cpp.

◆ createTosaDowngrade1p1To1p0Pass()

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

We declare an explicit private instantiation because Pass classes should only be visible by the current library.

Definition at line 358 of file TosaDowngrade1p1To1p0.cpp.

◆ createTosaGatherScatterHardeningPass()

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

We declare an explicit private instantiation because Pass classes should only be visible by the current library.

Definition at line 433 of file TosaGatherScatterHardening.cpp.

◆ createTosaInferShapesPass() [1/2]

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

Definition at line 528 of file TosaInferShapes.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaInferShapesPass() [2/2]

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

Definition at line 532 of file TosaInferShapes.cpp.

◆ createTosaInputShapePass()

std::unique_ptr< Pass > mlir::tosa::createTosaInputShapePass ( std::vector< std::string > args = {})

Definition at line 183 of file TosaInputShape.cpp.

◆ createTosaLayerwiseConstantFoldPass() [1/2]

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

Definition at line 692 of file TosaLayerwiseConstantFoldPass.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaLayerwiseConstantFoldPass() [2/2]

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

Definition at line 696 of file TosaLayerwiseConstantFoldPass.cpp.

◆ createTosaMakeBroadcastablePass()

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

We declare an explicit private instantiation because Pass classes should only be visible by the current library.

Definition at line 771 of file TosaMakeBroadcastable.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaNarrowF32ToF16Pass() [1/2]

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

Definition at line 868 of file TosaNarrowTypes.cpp.

◆ createTosaNarrowF32ToF16Pass() [2/2]

std::unique_ptr<::mlir::Pass > mlir::tosa::createTosaNarrowF32ToF16Pass ( TosaNarrowF32ToF16PassOptions options)

Definition at line 872 of file TosaNarrowTypes.cpp.

References options.

◆ createTosaNarrowF64ToF32Pass() [1/2]

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

Definition at line 966 of file TosaNarrowTypes.cpp.

◆ createTosaNarrowF64ToF32Pass() [2/2]

std::unique_ptr<::mlir::Pass > mlir::tosa::createTosaNarrowF64ToF32Pass ( TosaNarrowF64ToF32PassOptions options)

Definition at line 970 of file TosaNarrowTypes.cpp.

◆ createTosaNarrowI64ToI32Pass() [1/2]

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

Definition at line 1064 of file TosaNarrowTypes.cpp.

◆ createTosaNarrowI64ToI32Pass() [2/2]

std::unique_ptr<::mlir::Pass > mlir::tosa::createTosaNarrowI64ToI32Pass ( TosaNarrowI64ToI32PassOptions options)

Definition at line 1068 of file TosaNarrowTypes.cpp.

◆ createTosaOptionalDecompositionsPass()

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

We declare an explicit private instantiation because Pass classes should only be visible by the current library.

Definition at line 1143 of file TosaOptionalDecompositions.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaReduceTransposes()

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

We declare an explicit private instantiation because Pass classes should only be visible by the current library.

Definition at line 1218 of file TosaReduceTransposes.cpp.

◆ createTosaTestQuantUtilAPIPass()

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

◆ createTosaToLinalg()

std::unique_ptr< Pass > mlir::tosa::createTosaToLinalg ( const TosaToLinalgOptions & options = TosaToLinalgOptions())

Definition at line 85 of file TosaToLinalgPass.cpp.

References options.

Referenced by addTosaToLinalgPasses().

◆ createTosaToLinalgNamed()

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

Definition at line 90 of file TosaToLinalgNamedPass.cpp.

References options.

Referenced by addTosaToLinalgPasses().

◆ createTosaToSPIRVTosa()

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

Definition at line 279 of file TosaToSPIRVTosaPass.cpp.

◆ createTosaToSPIRVTosaMarkGraphConstants()

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

Definition at line 88 of file TosaToSPIRVTosaConstants.cpp.

◆ createTosaValidation() [1/2]

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

Definition at line 1315 of file TosaValidation.cpp.

Referenced by addTosaToLinalgPasses().

◆ createTosaValidation() [2/2]

std::unique_ptr<::mlir::Pass > mlir::tosa::createTosaValidation ( TosaValidationOptions options)

Definition at line 1319 of file TosaValidation.cpp.

◆ createZeroPointTensor()

◆ createZPsAsConst()

◆ EqualizeRanks() [1/2]

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

Definition at line 122 of file ConversionUtils.cpp.

References getTosaConstShape(), mlir::Value::getType(), and success().

◆ 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 116 of file ConversionUtils.cpp.

References EqualizeRanks().

Referenced by CreateOpAndInferShape(), and EqualizeRanks().

◆ getBitWidth()

unsigned mlir::tosa::getBitWidth ( Type type)

Definition at line 331 of file TosaOps.cpp.

References getBitWidth(), and mlir::Type::getIntOrFloatBitWidth().

Referenced by getBitWidth().

◆ getConstantScalarIntValue()

template<typename T>
template FailureOr< int32_t > mlir::tosa::getConstantScalarIntValue< int32_t > ( Value val)

Definition at line 260 of file ConversionUtils.cpp.

References mlir::m_Constant(), and mlir::matchPattern().

Referenced by RowGatherToGather::matchAndRewrite().

◆ getConstShapeValues()

◆ getConstTensorInt()

template<typename IntType>
Value mlir::tosa::getConstTensorInt ( OpBuilder & builder,
Location loc,
ArrayRef< IntType > vec )

Definition at line 36 of file QuantUtils.h.

References mlir::DenseElementsAttr::get(), and mlir::Builder::getIntegerType().

◆ getCooperativeProfiles()

SmallVector< Profile, 2 > mlir::tosa::getCooperativeProfiles ( Extension ext)

Definition at line 73 of file TargetEnv.cpp.

Referenced by mlir::tosa::TargetEnv::verifyTargetInformation().

◆ getDefaultTargetEnv()

TargetEnvAttr mlir::tosa::getDefaultTargetEnv ( MLIRContext * context)

Definition at line 195 of file TargetEnv.cpp.

Referenced by lookupTargetEnvOrDefault().

◆ getDefaultVerCapExtAttr()

spirv::VerCapExtAttr mlir::tosa::getDefaultVerCapExtAttr ( MLIRContext * context)

◆ getFloatMinMaxIdentity()

APFloat mlir::tosa::getFloatMinMaxIdentity ( const llvm::fltSemantics & semantics,
bool negative,
bool allowNonFinites )

Definition at line 65 of file ConversionUtils.cpp.

Referenced by createInitialValueForReduceOp().

◆ getMinVersion() [1/3]

TosaSpecificationVersion mlir::tosa::getMinVersion ( const Extension & extension)

Definition at line 41 of file TargetEnv.cpp.

◆ getMinVersion() [2/3]

TosaSpecificationVersion mlir::tosa::getMinVersion ( const Level & level)

Definition at line 106 of file TargetEnv.cpp.

◆ getMinVersion() [3/3]

TosaSpecificationVersion mlir::tosa::getMinVersion ( const Profile & profile)

Definition at line 30 of file TargetEnv.cpp.

Referenced by mlir::tosa::TargetEnv::verifyTargetInformation().

◆ getNParallelLoopsAttrs()

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

◆ getStorageElementTypeFromQuantized()

Type mlir::tosa::getStorageElementTypeFromQuantized ( quant::QuantizedType quantizedType)

◆ getStorageElementTypeOrSelf() [1/2]

◆ getStorageElementTypeOrSelf() [2/2]

Type mlir::tosa::getStorageElementTypeOrSelf ( Value value)

Definition at line 292 of file TosaOps.cpp.

References getStorageElementTypeOrSelf(), and mlir::Value::getType().

◆ getTosaConstShape() [1/2]

◆ getTosaConstShape() [2/2]

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

Definition at line 185 of file ConversionUtils.cpp.

References getTosaConstShape().

◆ getTosaLevelFromEnum()

TosaLevel mlir::tosa::getTosaLevelFromEnum ( const Level level)

Definition at line 15 of file TargetEnv.cpp.

References TOSA_LEVEL_EIGHTK, and TOSA_LEVEL_NONE.

Referenced by ConsecutiveConcatOptimization::matchAndRewrite().

◆ getTosaTensorTypeErrorMessage()

std::string mlir::tosa::getTosaTensorTypeErrorMessage ( mlir::Type type)

◆ getVariableType()

RankedTensorType mlir::tosa::getVariableType ( VariableOp variableOp)

References mlir::emitError().

Referenced by verifyVariableOpErrorIf().

◆ hasUniqueConstantScatterIndices()

bool mlir::tosa::hasUniqueConstantScatterIndices ( ShapedType indicesType,
DenseIntElementsAttr indicesAttr )

Definition at line 231 of file ConversionUtils.cpp.

References b, and indices.

◆ isa_tosa_shape_type()

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

Definition at line 5717 of file TosaOps.cpp.

◆ lookupTargetEnv()

◆ lookupTargetEnvOrDefault()

TargetEnvAttr mlir::tosa::lookupTargetEnvOrDefault ( Operation * op)

Queries the target environment recursively from enclosing symbol table ops containing the given op or returns the default target environment as returned by getDefaultTargetEnv() if not provided.

Definition at line 200 of file TargetEnv.cpp.

References mlir::Operation::getContext(), getDefaultTargetEnv(), and lookupTargetEnv().

◆ parseVariableOpTypeOrInitialValue()

ParseResult mlir::tosa::parseVariableOpTypeOrInitialValue ( OpAsmParser & parser,
DenseElementsAttr & varShapeAttr,
TypeAttr & typeAttr,
Attribute & initialValueAttr )

◆ populateTosaConstantReduction()

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

Definition at line 469 of file TosaFolders.cpp.

References mlir::RewritePatternSet::add().

◆ populateTosaDecomposeDepthwise()

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

Definition at line 199 of file TosaDecomposeDepthwise.cpp.

References mlir::RewritePatternSet::add().

◆ populateTosaDecomposeTransposeConv()

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

Definition at line 345 of file TosaDecomposeTransposeConv.cpp.

References mlir::RewritePatternSet::add().

◆ populateTosaFoldConstantReciprocalPatterns()

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

Definition at line 491 of file TosaFolders.cpp.

References mlir::RewritePatternSet::add().

◆ populateTosaFoldConstantTransposePatterns()

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

Definition at line 486 of file TosaFolders.cpp.

References mlir::RewritePatternSet::add().

◆ populateTosaRescaleToArithConversionPatterns()

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

◆ populateTosaToArithConversionPatterns()

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

◆ populateTosaToLinalgConversionPatterns()

void mlir::tosa::populateTosaToLinalgConversionPatterns ( const TypeConverter & converter,
RewritePatternSet * patterns,
const TosaToLinalgOptions & options = TosaToLinalgOptions() )

Populates conversion passes from TOSA dialect to Linalg dialect.

Definition at line 3448 of file TosaToLinalg.cpp.

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

◆ 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 1226 of file TosaToLinalgNamed.cpp.

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

◆ populateTosaToMLProgramConversionPatterns()

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

◆ populateTosaToSCFConversionPatterns()

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

◆ populateTosaToSPIRVTosaConversionPatterns()

void mlir::tosa::populateTosaToSPIRVTosaConversionPatterns ( SPIRVTypeConverter & typeConverter,
RewritePatternSet & patterns,
spirv::TargetEnvAttr targetAttr )

◆ populateTosaToSPIRVTosaCustomConversionPatterns()

void mlir::tosa::populateTosaToSPIRVTosaCustomConversionPatterns ( SPIRVTypeConverter & typeConverter,
RewritePatternSet & patterns,
llvm::StringMap< int32_t > domainToOpcode )

◆ populateTosaToSPIRVTosaOpsConversionPatterns()

void mlir::tosa::populateTosaToSPIRVTosaOpsConversionPatterns ( SPIRVTypeConverter & typeConverter,
RewritePatternSet & patterns )

◆ populateTosaToTensorConversionPatterns()

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

◆ populateTosaTypeConversion()

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

◆ prepareMatMulTOperands()

MatMulTOperands mlir::tosa::prepareMatMulTOperands ( PatternRewriter & rewriter,
Location loc,
Value a,
Value b,
RankedTensorType outputType )

Broadcast the batch dimensions of the ranked operands and create a zero-filled result tensor for either MATMUL_T lowering pattern.

Definition at line 1545 of file TosaToLinalg.cpp.

References b, condenseValues(), mlir::tensor::getMixedSize(), mlir::getValueOrCreateConstantIndexOp(), mlir::Builder::getZeroAttr(), normalizeMatMulTBatchDimensions(), and result.

◆ printVariableOpTypeOrInitialValue()

void mlir::tosa::printVariableOpTypeOrInitialValue ( OpAsmPrinter & p,
Operation * op,
DenseElementsAttr varShapeAttr,
TypeAttr typeAttr,
Attribute initialValueAttr )

◆ registerShardingInterfaceExternalModels()

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

◆ registerTosaArithConstantToTosaConstPass()

void mlir::tosa::registerTosaArithConstantToTosaConstPass ( )
inline

Definition at line 1348 of file Passes.h.

◆ registerTosaArithConstantToTosaConstPassPass()

void mlir::tosa::registerTosaArithConstantToTosaConstPassPass ( )
inline

Definition at line 1355 of file Passes.h.

◆ registerTosaAttachTarget()

void mlir::tosa::registerTosaAttachTarget ( )
inline

Definition at line 1369 of file Passes.h.

◆ registerTosaAttachTargetPass()

void mlir::tosa::registerTosaAttachTargetPass ( )
inline

Definition at line 1376 of file Passes.h.

◆ registerTosaConvertIntegerTypeToSignless()

void mlir::tosa::registerTosaConvertIntegerTypeToSignless ( )
inline

Definition at line 1390 of file Passes.h.

◆ registerTosaConvertIntegerTypeToSignlessPass()

void mlir::tosa::registerTosaConvertIntegerTypeToSignlessPass ( )
inline

Definition at line 1397 of file Passes.h.

◆ registerTosaDowngrade1p1To1p0Pass()

void mlir::tosa::registerTosaDowngrade1p1To1p0Pass ( )
inline

Definition at line 1411 of file Passes.h.

◆ registerTosaDowngrade1p1To1p0PassPass()

void mlir::tosa::registerTosaDowngrade1p1To1p0PassPass ( )
inline

Definition at line 1418 of file Passes.h.

◆ registerTosaGatherScatterHardeningPass()

void mlir::tosa::registerTosaGatherScatterHardeningPass ( )
inline

Definition at line 1432 of file Passes.h.

◆ registerTosaGatherScatterHardeningPassPass()

void mlir::tosa::registerTosaGatherScatterHardeningPassPass ( )
inline

Definition at line 1439 of file Passes.h.

◆ registerTosaInferShapesPass()

void mlir::tosa::registerTosaInferShapesPass ( )
inline

Definition at line 1453 of file Passes.h.

◆ registerTosaInferShapesPassPass()

void mlir::tosa::registerTosaInferShapesPassPass ( )
inline

Definition at line 1460 of file Passes.h.

◆ registerTosaInputShape()

void mlir::tosa::registerTosaInputShape ( )
inline

Definition at line 1474 of file Passes.h.

◆ registerTosaInputShapePass()

void mlir::tosa::registerTosaInputShapePass ( )
inline

Definition at line 1481 of file Passes.h.

◆ registerTosaLayerwiseConstantFoldPass()

void mlir::tosa::registerTosaLayerwiseConstantFoldPass ( )
inline

Definition at line 1495 of file Passes.h.

◆ registerTosaLayerwiseConstantFoldPassPass()

void mlir::tosa::registerTosaLayerwiseConstantFoldPassPass ( )
inline

Definition at line 1502 of file Passes.h.

◆ registerTosaMakeBroadcastablePass()

void mlir::tosa::registerTosaMakeBroadcastablePass ( )
inline

Definition at line 1516 of file Passes.h.

◆ registerTosaMakeBroadcastablePassPass()

void mlir::tosa::registerTosaMakeBroadcastablePassPass ( )
inline

Definition at line 1523 of file Passes.h.

◆ registerTosaNarrowF32ToF16Pass()

void mlir::tosa::registerTosaNarrowF32ToF16Pass ( )
inline

Definition at line 1537 of file Passes.h.

◆ registerTosaNarrowF32ToF16PassPass()

void mlir::tosa::registerTosaNarrowF32ToF16PassPass ( )
inline

Definition at line 1544 of file Passes.h.

◆ registerTosaNarrowF64ToF32Pass()

void mlir::tosa::registerTosaNarrowF64ToF32Pass ( )
inline

Definition at line 1558 of file Passes.h.

◆ registerTosaNarrowF64ToF32PassPass()

void mlir::tosa::registerTosaNarrowF64ToF32PassPass ( )
inline

Definition at line 1565 of file Passes.h.

◆ registerTosaNarrowI64ToI32Pass()

void mlir::tosa::registerTosaNarrowI64ToI32Pass ( )
inline

Definition at line 1579 of file Passes.h.

◆ registerTosaNarrowI64ToI32PassPass()

void mlir::tosa::registerTosaNarrowI64ToI32PassPass ( )
inline

Definition at line 1586 of file Passes.h.

◆ registerTosaOptionalDecompositionsPass()

void mlir::tosa::registerTosaOptionalDecompositionsPass ( )
inline

Definition at line 1600 of file Passes.h.

◆ registerTosaOptionalDecompositionsPassPass()

void mlir::tosa::registerTosaOptionalDecompositionsPassPass ( )
inline

Definition at line 1607 of file Passes.h.

◆ registerTosaPasses()

void mlir::tosa::registerTosaPasses ( )
inline

Definition at line 1663 of file Passes.h.

Referenced by mlir::registerAllPasses().

◆ registerTosaReduceTransposes()

void mlir::tosa::registerTosaReduceTransposes ( )
inline

Definition at line 1621 of file Passes.h.

◆ registerTosaReduceTransposesPass()

void mlir::tosa::registerTosaReduceTransposesPass ( )
inline

Definition at line 1628 of file Passes.h.

◆ registerTosaToLinalgPipelines()

void mlir::tosa::registerTosaToLinalgPipelines ( )

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

Definition at line 143 of file TosaToLinalgPass.cpp.

References addTosaToLinalgPasses().

Referenced by mlir::registerAllPasses().

◆ registerTosaValidation()

void mlir::tosa::registerTosaValidation ( )
inline

Definition at line 1642 of file Passes.h.

◆ registerTosaValidationPass()

void mlir::tosa::registerTosaValidationPass ( )
inline

Definition at line 1649 of file Passes.h.

◆ stringifyVersion()

◆ tryGetDenseResourceValues()

template<typename T>
std::optional< ArrayRef< T > > mlir::tosa::tryGetDenseResourceValues ( ElementsAttr attr)

◆ validIntegerRange()

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

Definition at line 51 of file ConversionUtils.cpp.

◆ verifyBlockScaledTensorType()

LogicalResult mlir::tosa::verifyBlockScaledTensorType ( mlir::Type type,
llvm::function_ref< mlir::InFlightDiagnostic()> emitError = nullptr,
bool allowScaleValues = false )

Definition at line 444 of file TosaOps.cpp.

References mlir::emitError(), and success().

Referenced by getTosaTensorTypeErrorMessage().

Variable Documentation

◆ graphARMGraphConstantIdAttrName

llvm::StringLiteral mlir::tosa::graphARMGraphConstantIdAttrName
constexpr
Initial value:
=
"grapharm.graph_constant_id"

Definition at line 41 of file TosaToSPIRVTosa.h.

◆ graphARMInterfaceVarABIAttrName

llvm::StringLiteral mlir::tosa::graphARMInterfaceVarABIAttrName
constexpr
Initial value:
=
"grapharm.interface_var_abi"

Definition at line 36 of file TosaToSPIRVTosa.h.

◆ kInferableDimSize

int64_t mlir::tosa::kInferableDimSize = -1
constexpr

Represents a dimension in the shape of a tensor that can be inferred based on the other provided dimensions.

For example, in a reshape operation, -1 can be used to indicate a size that is the remainder of the other dimensions.

Definition at line 102 of file TosaOps.h.

Referenced by PadSliceOptimization::matchAndRewrite(), and SliceDynamicSizeCanonicalization::matchAndRewrite().

◆ TOSA_LEVEL_EIGHTK

TosaLevel mlir::tosa::TOSA_LEVEL_EIGHTK
staticconstexpr
Initial value:
= {6, 8192, 8192, 256,
31, 6, 64, 16}

Definition at line 43 of file TargetEnv.h.

Referenced by getTosaLevelFromEnum().

◆ TOSA_LEVEL_NONE

TosaLevel mlir::tosa::TOSA_LEVEL_NONE
staticconstexpr
Initial value:
= {32, 2147483647, 2147483647, 2048,
63, 256, 256, 64}

Definition at line 45 of file TargetEnv.h.

Referenced by getTosaLevelFromEnum().