MLIR
20.0.0git
|
#include "mlir/Dialect/Tosa/Utils/QuantUtils.h"
Go to the source code of this file.
Macros | |
#define | GET_UQTYPE(inputType) (llvm::dyn_cast<quant::UniformQuantizedType>((inputType).getElementType())) |
#define | GET_QTYPE(inputType) (llvm::dyn_cast<quant::QuantizedType>((inputType).getElementType())) |
Functions | |
static void | computeMultiplierAndShiftTosaScale16 (double scale, int32_t &multiplier, int32_t &shift) |
From a scale value, generates multiplier and shift values where mantissa is in [-1.0,-0.5] or [0.5, 1.0] such that multiplier = mantissa*2^shift for 16-bit scaling. More... | |
static void | computeMultiplierAndShiftTosaScale32 (double scale, int32_t &multiplier, int32_t &shift) |
From a scale value, generates multiplier and shift values where mantissa is in [-1.0,-0.5] or [0.5, 1.0] such that multiplier = mantissa*2^shift for 32-bit scaling. More... | |
#define GET_QTYPE | ( | inputType | ) | (llvm::dyn_cast<quant::QuantizedType>((inputType).getElementType())) |
Definition at line 112 of file QuantUtils.cpp.
#define GET_UQTYPE | ( | inputType | ) | (llvm::dyn_cast<quant::UniformQuantizedType>((inputType).getElementType())) |
Definition at line 110 of file QuantUtils.cpp.
|
static |
From a scale value, generates multiplier and shift values where mantissa is in [-1.0,-0.5] or [0.5, 1.0] such that multiplier = mantissa*2^shift for 16-bit scaling.
Definition at line 22 of file QuantUtils.cpp.
References frexp(), max(), and mlir::presburger::round().
Referenced by mlir::tosa::computeMultiplierAndShift().
|
static |
From a scale value, generates multiplier and shift values where mantissa is in [-1.0,-0.5] or [0.5, 1.0] such that multiplier = mantissa*2^shift for 32-bit scaling.
Definition at line 60 of file QuantUtils.cpp.
References frexp(), max(), and mlir::presburger::round().
Referenced by mlir::tosa::computeMultiplierAndShift().