tvm
Public Member Functions | List of all members
tvm::SHashReducer::Handler Class Referenceabstract

Internal handler that defines custom behaviors. More...

#include <structural_hash.h>

Inheritance diagram for tvm::SHashReducer::Handler:
Collaboration diagram for tvm::SHashReducer::Handler:

Public Member Functions

virtual void SHashReduceHashedValue (uint64_t hashed_value)=0
 Append hashed_value to the current sequence of hashes. More...
 
virtual void SHashReduce (const ObjectRef &key, bool map_free_vars)=0
 Append hash value of key to the current sequence of hashes. More...
 
virtual void SHashReduceFreeVar (const runtime::Object *var, bool map_free_vars)=0
 Append a hash value of free variable to the current sequence of hashes. More...
 
virtual bool LookupHashedValue (const ObjectRef &key, uint64_t *hashed_value)=0
 Lookup a hash value for key. More...
 
virtual void MarkGraphNode ()=0
 Mark current comparison as graph node in hashing. Graph node hash will depends on the graph structure. More...
 

Detailed Description

Internal handler that defines custom behaviors.

Member Function Documentation

◆ LookupHashedValue()

virtual bool tvm::SHashReducer::Handler::LookupHashedValue ( const ObjectRef key,
uint64_t *  hashed_value 
)
pure virtual

Lookup a hash value for key.

Parameters
keyThe hash key.
hashed_valuethe result hash value
Returns
Whether there is already a pre-computed hash value.

Implemented in tvm::SHashHandlerDefault.

◆ MarkGraphNode()

virtual void tvm::SHashReducer::Handler::MarkGraphNode ( )
pure virtual

Mark current comparison as graph node in hashing. Graph node hash will depends on the graph structure.

Implemented in tvm::SHashHandlerDefault.

◆ SHashReduce()

virtual void tvm::SHashReducer::Handler::SHashReduce ( const ObjectRef key,
bool  map_free_vars 
)
pure virtual

Append hash value of key to the current sequence of hashes.

Parameters
keyThe object to compute hash from.
map_free_varsWhether to map free variables by their occurrence number.

Implemented in tvm::SHashHandlerDefault.

◆ SHashReduceFreeVar()

virtual void tvm::SHashReducer::Handler::SHashReduceFreeVar ( const runtime::Object var,
bool  map_free_vars 
)
pure virtual

Append a hash value of free variable to the current sequence of hashes.

Parameters
varThe var of interest.
map_free_varsWhether to map free variables by their occurrence number.
Note
If map_free_vars is set to be true, internally the handler can maintain a counter to encode free variables by their order of occurrence. This helps to resolve variable mapping of function parameters and let binding variables.

If map_free_vars is set to be false, the address of the variable will be used.

Implemented in tvm::SHashHandlerDefault.

◆ SHashReduceHashedValue()

virtual void tvm::SHashReducer::Handler::SHashReduceHashedValue ( uint64_t  hashed_value)
pure virtual

Append hashed_value to the current sequence of hashes.

Parameters
hashed_valueThe hashed value

Implemented in tvm::SHashHandlerDefault.


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