My Project
Public Member Functions | Public Attributes | List of all members
mlir::fxpmath::detail::UniformBinaryOpInfo Struct Reference

#include <UniformKernelUtils.h>

Collaboration diagram for mlir::fxpmath::detail::UniformBinaryOpInfo:
Collaboration graph
[legend]

Public Member Functions

 UniformBinaryOpInfo (Operation *op, Value lhs, Value rhs, Optional< APFloat > clampMin, Optional< APFloat > clampMax)
 
bool isValid () const
 Returns whether this info is valid (all types defined, etc). More...
 
Type getQuantizedResultType () const
 Gets the final quantized result type of the result. More...
 
bool isSameStorageType () const
 Returns whether the storage type of all operands is identical. More...
 
bool isFixedPointPOT (int &lhsLog2Scale, int &rhsLog2Scale, int &resultLog2Scale) const
 
std::pair< IntegerAttr, IntegerAttrgetClampMinMax (IntegerType ty) const
 Gets the result integer clamp range given the result quantized type. More...
 

Public Attributes

Operationop
 
Value lhs
 
Value rhs
 
Optional< APFloat > clampMin
 
Optional< APFloat > clampMax
 
quant::UniformQuantizedType lhsType
 
quant::UniformQuantizedType rhsType
 
quant::UniformQuantizedType resultType
 
Type lhsStorageType
 
Type rhsStorageType
 
Type resultStorageType
 

Detailed Description

Helper class for operating on binary operations where all operands and the result are a UniformQuantizedType.

Constructor & Destructor Documentation

◆ UniformBinaryOpInfo()

mlir::fxpmath::detail::UniformBinaryOpInfo::UniformBinaryOpInfo ( Operation op,
Value  lhs,
Value  rhs,
Optional< APFloat >  clampMin,
Optional< APFloat >  clampMax 
)
inline

Member Function Documentation

◆ getClampMinMax()

std::pair<IntegerAttr, IntegerAttr> mlir::fxpmath::detail::UniformBinaryOpInfo::getClampMinMax ( IntegerType  ty) const
inline

Gets the result integer clamp range given the result quantized type.

◆ getQuantizedResultType()

Type mlir::fxpmath::detail::UniformBinaryOpInfo::getQuantizedResultType ( ) const
inline

Gets the final quantized result type of the result.

◆ isFixedPointPOT()

bool mlir::fxpmath::detail::UniformBinaryOpInfo::isFixedPointPOT ( int &  lhsLog2Scale,
int &  rhsLog2Scale,
int &  resultLog2Scale 
) const
inline

Returns whether all operands and result are considered fixedpoint power of two, setting the lhs, rhs, and result log2 scale references.

◆ isSameStorageType()

bool mlir::fxpmath::detail::UniformBinaryOpInfo::isSameStorageType ( ) const
inline

Returns whether the storage type of all operands is identical.

◆ isValid()

bool mlir::fxpmath::detail::UniformBinaryOpInfo::isValid ( ) const
inline

Returns whether this info is valid (all types defined, etc).

Member Data Documentation

◆ clampMax

Optional<APFloat> mlir::fxpmath::detail::UniformBinaryOpInfo::clampMax

◆ clampMin

Optional<APFloat> mlir::fxpmath::detail::UniformBinaryOpInfo::clampMin

◆ lhs

Value mlir::fxpmath::detail::UniformBinaryOpInfo::lhs

◆ lhsStorageType

Type mlir::fxpmath::detail::UniformBinaryOpInfo::lhsStorageType

◆ lhsType

quant::UniformQuantizedType mlir::fxpmath::detail::UniformBinaryOpInfo::lhsType

◆ op

Operation* mlir::fxpmath::detail::UniformBinaryOpInfo::op

◆ resultStorageType

Type mlir::fxpmath::detail::UniformBinaryOpInfo::resultStorageType

◆ resultType

quant::UniformQuantizedType mlir::fxpmath::detail::UniformBinaryOpInfo::resultType

◆ rhs

Value mlir::fxpmath::detail::UniformBinaryOpInfo::rhs

◆ rhsStorageType

Type mlir::fxpmath::detail::UniformBinaryOpInfo::rhsStorageType

◆ rhsType

quant::UniformQuantizedType mlir::fxpmath::detail::UniformBinaryOpInfo::rhsType

The documentation for this struct was generated from the following file: