tvm
|
The default handler for hash key computation. More...
#include <structural_hash.h>
Public Member Functions | |
SHashHandlerDefault () | |
virtual | ~SHashHandlerDefault () |
void | SHashReduceHashedValue (uint64_t hashed_value) override |
Append hashed_value to the current sequence of hashes. More... | |
void | SHashReduce (const ObjectRef &key, bool map_free_vars) override |
Append hash value of key to the current sequence of hashes. More... | |
void | SHashReduceFreeVar (const runtime::Object *var, bool map_free_vars) override |
Append a hash value of free variable to the current sequence of hashes. More... | |
bool | LookupHashedValue (const ObjectRef &key, uint64_t *hashed_value) override |
Lookup a hash value for key. More... | |
void | MarkGraphNode () override |
Mark current comparison as graph node in hashing. Graph node hash will depends on the graph structure. More... | |
virtual uint64_t | Hash (const ObjectRef &object, bool map_free_vars) |
The entry point for hashing. More... | |
Protected Member Functions | |
virtual void | DispatchSHash (const ObjectRef &object, bool map_free_vars) |
The dispatcher for hashing of intermediate objects. More... | |
The default handler for hash key computation.
Users can derive from this class and override the DispatchSHash method, to customize hashing.
tvm::SHashHandlerDefault::SHashHandlerDefault | ( | ) |
|
virtual |
|
protectedvirtual |
The dispatcher for hashing of intermediate objects.
object | An intermediate object to be hashed. |
map_free_vars | Whether or not to remap variables if possible. |
|
virtual |
The entry point for hashing.
object | The object to be hashed. |
map_free_vars | Whether or not to remap variables if possible. |
|
overridevirtual |
Lookup a hash value for key.
key | The hash key. |
hashed_value | the result hash value |
Implements tvm::SHashReducer::Handler.
|
overridevirtual |
Mark current comparison as graph node in hashing. Graph node hash will depends on the graph structure.
Implements tvm::SHashReducer::Handler.
|
overridevirtual |
Append hash value of key to the current sequence of hashes.
key | The object to compute hash from. |
map_free_vars | Whether to map free variables by their occurrence number. |
Implements tvm::SHashReducer::Handler.
|
overridevirtual |
Append a hash value of free variable to the current sequence of hashes.
var | The var of interest. |
map_free_vars | Whether to map free variables by their occurrence number. |
If map_free_vars is set to be false, the address of the variable will be used.
Implements tvm::SHashReducer::Handler.
|
overridevirtual |
Append hashed_value to the current sequence of hashes.
hashed_value | The hashed value |
Implements tvm::SHashReducer::Handler.