My Project
Public Types | Public Member Functions | List of all members
mlir::quantizer::CAGSlice Class Reference

A slice of a CAG (which may be the whole graph). More...

#include <ConstraintAnalysisGraph.h>

Public Types

using node_vector = std::vector< CAGNode * >
 
using iterator = node_vector::iterator
 
using const_iterator = node_vector::const_iterator
 

Public Member Functions

 CAGSlice (SolverContext &context)
 
 ~CAGSlice ()
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
CAGOperandAnchorgetOperandAnchor (Operation *op, unsigned operandIdx)
 Gets an operand anchor node. More...
 
CAGResultAnchorgetResultAnchor (Operation *op, unsigned resultIdx)
 Gets a result anchor node. More...
 
template<typename T , typename... Args>
T * addUniqueConstraint (ArrayRef< CAGAnchorNode *> anchors, Args... args)
 
template<typename T , typename... Args>
T * addUnidirectionalConstraint (CAGAnchorNode *fromAnchor, ArrayRef< CAGAnchorNode *> toAnchors, Args... args)
 Adds a unidirectional constraint from a node to an array of target nodes. More...
 
template<typename T >
T * addClusteredConstraint (ArrayRef< CAGAnchorNode *> anchors)
 
void enumerateImpliedConnections (std::function< void(CAGAnchorNode *from, CAGAnchorNode *to)> callback)
 
unsigned propagate (const TargetConfiguration &config)
 

Detailed Description

A slice of a CAG (which may be the whole graph).

Member Typedef Documentation

◆ const_iterator

using mlir::quantizer::CAGSlice::const_iterator = node_vector::const_iterator

◆ iterator

using mlir::quantizer::CAGSlice::iterator = node_vector::iterator

◆ node_vector

Constructor & Destructor Documentation

◆ CAGSlice()

CAGSlice::CAGSlice ( SolverContext context)

◆ ~CAGSlice()

CAGSlice::~CAGSlice ( )

Member Function Documentation

◆ addClusteredConstraint()

template<typename T >
T* mlir::quantizer::CAGSlice::addClusteredConstraint ( ArrayRef< CAGAnchorNode *>  anchors)
inline

◆ addUnidirectionalConstraint()

template<typename T , typename... Args>
T* mlir::quantizer::CAGSlice::addUnidirectionalConstraint ( CAGAnchorNode fromAnchor,
ArrayRef< CAGAnchorNode *>  toAnchors,
Args...  args 
)
inline

Adds a unidirectional constraint from a node to an array of target nodes.

◆ addUniqueConstraint()

template<typename T , typename... Args>
T* mlir::quantizer::CAGSlice::addUniqueConstraint ( ArrayRef< CAGAnchorNode *>  anchors,
Args...  args 
)
inline

Adds a relation constraint with incoming 'from' anchors and outgoing 'to' anchors.

◆ begin() [1/2]

iterator mlir::quantizer::CAGSlice::begin ( )
inline

◆ begin() [2/2]

const_iterator mlir::quantizer::CAGSlice::begin ( ) const
inline

◆ end() [1/2]

iterator mlir::quantizer::CAGSlice::end ( )
inline

◆ end() [2/2]

const_iterator mlir::quantizer::CAGSlice::end ( ) const
inline

◆ enumerateImpliedConnections()

void CAGSlice::enumerateImpliedConnections ( std::function< void(CAGAnchorNode *from, CAGAnchorNode *to)>  callback)

Enumerates all implied connections in the slice. An implied connection is any two nodes that physically refer to the same value in the IR, such as result->operand. Typically this will be modeled with some kind of strong or weak identity constraint such that types propagate. This is usually called when the slice has been fully constructed in order to add final constraints. It is legal for the callback to modify the graph by adding constraints.

◆ getOperandAnchor()

CAGOperandAnchor * CAGSlice::getOperandAnchor ( Operation op,
unsigned  operandIdx 
)

Gets an operand anchor node.

◆ getResultAnchor()

CAGResultAnchor * CAGSlice::getResultAnchor ( Operation op,
unsigned  resultIdx 
)

Gets a result anchor node.

◆ propagate()

unsigned CAGSlice::propagate ( const TargetConfiguration config)

Performs one round of propagation, returning the number of nodes propagates. If returns > 0, then additional propagate() rounds are required.


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