MLIR  20.0.0git
Namespaces | Functions
QuantUtils.h File Reference
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
#include "mlir/Dialect/Quant/Utils/FakeQuantSupport.h"
#include "mlir/Dialect/Quant/Utils/UniformSupport.h"

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::tosa
 

Functions

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. More...
 
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. More...
 
MatMulOpQuantizationAttr mlir::tosa::buildMatMulOpQuantizationAttr (OpBuilder &builder, Value a, Value b)
 Builds MatMulOpQuantizationAttr, called from MatMulOpQuantInfoBuilder: aZp: input a zeropoint bZp: input b zeropoint. More...
 
UnaryOpQuantizationAttr mlir::tosa::buildUnaryOpQuantizationAttr (OpBuilder &builder, Value input, Type outputRawType)
 Builds UnaryOpQuantizationAttr UnaryOpQuantInfoBuilder: inputZp: input zeropoint outputZp: output zeropoint. More...
 
PadOpQuantizationAttr mlir::tosa::buildPadOpQuantizationAttr (OpBuilder &builder, Value input)
 Builds PadOpQuantizationAttr, called from PadOpQuantInfoBuilder: inputZp: input zeropoint. More...
 
Type mlir::tosa::buildConvOpResultTypeInfo (OpBuilder &builder, Type outputType, Value input, Value weight)
 construct ConvOp output type with correct bitwidth based on input/weight width. More...
 
Type mlir::tosa::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 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. More...