My Project
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
mlir::quantizer::CAGAnchorNode Class Referenceabstract

#include <ConstraintAnalysisGraph.h>

Inheritance diagram for mlir::quantizer::CAGAnchorNode:
Inheritance graph
[legend]
Collaboration diagram for mlir::quantizer::CAGAnchorNode:
Collaboration graph
[legend]

Public Types

enum  TypeTransformRule { TypeTransformRule::Direct, TypeTransformRule::DirectStorage, TypeTransformRule::ExpressedOnly }
 
- Public Types inherited from mlir::quantizer::CAGNode
enum  Kind {
  Kind::Anchor, Kind::OperandAnchor, Kind::ResultAnchor, Kind::LastAnchor = ResultAnchor,
  Kind::Constraint, Kind::SolveUniformConstraint, Kind::UniformPropagateExplicitScale, Kind::LastConstraint = UniformPropagateExplicitScale
}
 
using node_vector = SmallVector< CAGNode *, 1 >
 
using iterator = node_vector::iterator
 
using const_iterator = node_vector::const_iterator
 

Public Member Functions

CAGUniformMetadatagetUniformMetadata ()
 Metadata for solving uniform quantization params. More...
 
const CAGUniformMetadatagetUniformMetadata () const
 
virtual OperationgetOp () const =0
 
virtual Value getValue () const =0
 
void propagate (SolverContext &solverContext, const TargetConfiguration &config) override
 
void printLabel (raw_ostream &os) const override
 Prints the node label, suitable for one-line display. More...
 
Type getTransformedType ()
 
TypeTransformRule getTypeTransformRule () const
 
void setTypeTransformRule (TypeTransformRule r)
 
Type getOriginalType () const
 
- Public Member Functions inherited from mlir::quantizer::CAGNode
virtual ~CAGNode ()=default
 
Kind getKind () const
 
int getNodeId () const
 Unique id of the node within the slice. More...
 
bool isDirty () const
 Whether the node is dirty, requiring one or more calls to propagate(). More...
 
void markDirty ()
 
void clearDirty ()
 
const_iterator begin () const
 Iterator over this node's children (outgoing) nodes. More...
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
const_iterator incoming_begin () const
 Iterator over this parents (incoming) nodes. More...
 
const_iterator incoming_end () const
 
iterator incoming_begin ()
 
iterator incoming_end ()
 
template<typename T >
void findChildrenOfKind (SmallVectorImpl< T *> &found)
 
void replaceIncoming (CAGNode *otherNode)
 
void addOutgoing (CAGNode *toNode)
 
bool isOrphan () const
 Whether this node is an orphan (has no incoming or outgoing connections). More...
 

Static Public Member Functions

static bool classof (const CAGNode *n)
 

Protected Member Functions

 CAGAnchorNode (Kind kind, Type originalType)
 
- Protected Member Functions inherited from mlir::quantizer::CAGNode
 CAGNode (Kind kind)
 

Detailed Description

Anchor nodes represent points in the source IR where we may choose to introduce a type transition. These include operands, results, arguments returns, etc.

Member Enumeration Documentation

◆ TypeTransformRule

Enumerator
Direct 

The owning op directly supports all transformed types. In practice, this means that the op supports QuantizedType for this anchor.

DirectStorage 

The type of this anchor should be set to the QuantizedType storage type. This will only be valid if constraints are such that all inputs/outputs converge to the same storage type (i.e. coupled).

ExpressedOnly 

The anchor must only be typed based on the expressed type. This is used for ops that do not natively support quantization, and suitable casts will be inserted.

Constructor & Destructor Documentation

◆ CAGAnchorNode()

mlir::quantizer::CAGAnchorNode::CAGAnchorNode ( Kind  kind,
Type  originalType 
)
inlineprotected

Member Function Documentation

◆ classof()

static bool mlir::quantizer::CAGAnchorNode::classof ( const CAGNode n)
inlinestatic

◆ getOp()

virtual Operation* mlir::quantizer::CAGAnchorNode::getOp ( ) const
pure virtual

◆ getOriginalType()

Type mlir::quantizer::CAGAnchorNode::getOriginalType ( ) const
inline

Gets the Type that was defined for this anchor at the time of construction.

◆ getTransformedType()

Type CAGAnchorNode::getTransformedType ( )

Given the anchor metadata and resolved solutions, chooses the most salient and returns an appropriate type to represent it.

◆ getTypeTransformRule()

TypeTransformRule mlir::quantizer::CAGAnchorNode::getTypeTransformRule ( ) const
inline

◆ getUniformMetadata() [1/2]

CAGUniformMetadata& mlir::quantizer::CAGAnchorNode::getUniformMetadata ( )
inline

Metadata for solving uniform quantization params.

◆ getUniformMetadata() [2/2]

const CAGUniformMetadata& mlir::quantizer::CAGAnchorNode::getUniformMetadata ( ) const
inline

◆ getValue()

virtual Value mlir::quantizer::CAGAnchorNode::getValue ( ) const
pure virtual

◆ printLabel()

void CAGAnchorNode::printLabel ( raw_ostream &  os) const
overridevirtual

Prints the node label, suitable for one-line display.

Reimplemented from mlir::quantizer::CAGNode.

Reimplemented in mlir::quantizer::CAGResultAnchor, and mlir::quantizer::CAGOperandAnchor.

◆ propagate()

void CAGAnchorNode::propagate ( SolverContext solverContext,
const TargetConfiguration config 
)
overridevirtual

Reimplemented from mlir::quantizer::CAGNode.

◆ setTypeTransformRule()

void mlir::quantizer::CAGAnchorNode::setTypeTransformRule ( TypeTransformRule  r)
inline

The documentation for this class was generated from the following files: