tvm
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
object_functor.h File Reference

Native object dispatch, visiting and mutation with structural fallback. More...

#include <tvm/ffi/error.h>
#include <tvm/ffi/extra/structural_mutate.h>
#include <tvm/ffi/extra/structural_visit.h>
#include <tvm/runtime/base.h>
#include <cstring>
#include <type_traits>
#include <utility>
#include <vector>
Include dependency graph for object_functor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tvm::ObjectFunctor< R(NodeArg, Args...)>
 
class  tvm::ObjectVisitor
 Native visiting with exact dispatch and structural fallback. More...
 
class  tvm::ObjectMutator
 Native mutation with exact dispatch and structural fallback. More...
 

Namespaces

namespace  tvm
 An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
 

Macros

#define TVM_DEFINE_OBJECT_FUNCTOR_DEFAULT_CONSTRUCTOR(Class, Parent)
 Define a default constructor backed by one initialized native dispatch table.
 

Detailed Description

Native object dispatch, visiting and mutation with structural fallback.

Macro Definition Documentation

◆ TVM_DEFINE_OBJECT_FUNCTOR_DEFAULT_CONSTRUCTOR

#define TVM_DEFINE_OBJECT_FUNCTOR_DEFAULT_CONSTRUCTOR (   Class,
  Parent 
)
Value:
Class() \
: Parent([] { \
static const VTable table = [] { \
VTable table; \
Class::InitVTable(&table); \
table.Finalize(); \
return table; \
}(); \
return &table; \
}()) {}

Define a default constructor backed by one initialized native dispatch table.

Parameters
ClassThe class whose default constructor is defined.
ParentThe parent accepting a const VTable pointer in its constructor.
Note
Class must provide InitVTable(VTable*) including inherited registrations. The table is initialized and finalized once; explicit table-taking constructors are separate.