PassContext that is used to configure the pass behavior.
More...
#include <transform.h>
|
| PassContext () |
|
| PassContext (ObjectPtr< Object > n) |
|
const PassContextNode * | operator-> () const |
| const accessor. More...
|
|
PassContextNode * | operator-> () |
| mutable accessor. More...
|
|
void | InstrumentEnterPassContext () |
| Call instrument implementations' callbacks when entering PassContext. The callbacks are called in order, and if one raises an exception, the rest will not be called. More...
|
|
void | InstrumentExitPassContext () |
| Call instrument implementations' callbacks when exiting PassContext. The callbacks are called in order, and if one raises an exception, the rest will not be called. More...
|
|
bool | InstrumentBeforePass (const IRModule &mod, const PassInfo &info) const |
| Call instrument implementations' callbacks before a pass run. The callbacks are called in order, and if one raises an exception, the rest will not be called. More...
|
|
void | InstrumentAfterPass (const IRModule &mod, const PassInfo &info) const |
| Call instrument implementations callbacks after a pass run. The callbacks are called in order, and if one raises an exception, the rest will not be called. More...
|
|
bool | PassEnabled (const PassInfo &info) const |
| Check whether a pass is enabled. More...
|
|
| ObjectRef ()=default |
| default constructor More...
|
|
| ObjectRef (ObjectPtr< Object > data) |
| Constructor from existing object ptr. More...
|
|
bool | same_as (const ObjectRef &other) const |
| Comparator. More...
|
|
bool | operator== (const ObjectRef &other) const |
| Comparator. More...
|
|
bool | operator!= (const ObjectRef &other) const |
| Comparator. More...
|
|
bool | operator< (const ObjectRef &other) const |
| Comparator. More...
|
|
bool | defined () const |
|
const Object * | get () const |
|
const Object * | operator-> () const |
|
bool | unique () const |
|
int | use_count () const |
|
template<typename ObjectType , typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>> |
const ObjectType * | as () const |
| Try to downcast the internal Object to a raw pointer of a corresponding type. More...
|
|
template<typename ObjectRefType , typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>> |
Optional< ObjectRefType > | as () const |
| Try to downcast the ObjectRef to a Optional<T> of the requested type. More...
|
|
PassContext that is used to configure the pass behavior.
ctx->opt_level = 2;
friend class With< PassContext >
Definition: transform.h:322
static PassContext Create()
Construct a PassContext containing the default configurations.
- See also
- PassContextNode
◆ ContainerType
◆ PassContext() [1/2]
tvm::transform::PassContext::PassContext |
( |
| ) |
|
|
inline |
◆ PassContext() [2/2]
◆ Create()
static PassContext tvm::transform::PassContext::Create |
( |
| ) |
|
|
static |
◆ Current()
static PassContext tvm::transform::PassContext::Current |
( |
| ) |
|
|
static |
Get the default pass context in the current scope.
- Returns
- The pass context.
◆ InstrumentAfterPass()
void tvm::transform::PassContext::InstrumentAfterPass |
( |
const IRModule & |
mod, |
|
|
const PassInfo & |
info |
|
) |
| const |
Call instrument implementations callbacks after a pass run. The callbacks are called in order, and if one raises an exception, the rest will not be called.
- Parameters
-
mod | The module that an optimization pass runs on. |
info | The pass information. |
◆ InstrumentBeforePass()
bool tvm::transform::PassContext::InstrumentBeforePass |
( |
const IRModule & |
mod, |
|
|
const PassInfo & |
info |
|
) |
| const |
Call instrument implementations' callbacks before a pass run. The callbacks are called in order, and if one raises an exception, the rest will not be called.
- Parameters
-
mod | The module that an optimization pass runs on. |
info | The pass information. |
- Returns
- false: the pass is skipped; true: the pass runs.
◆ InstrumentEnterPassContext()
void tvm::transform::PassContext::InstrumentEnterPassContext |
( |
| ) |
|
Call instrument implementations' callbacks when entering PassContext. The callbacks are called in order, and if one raises an exception, the rest will not be called.
◆ InstrumentExitPassContext()
void tvm::transform::PassContext::InstrumentExitPassContext |
( |
| ) |
|
Call instrument implementations' callbacks when exiting PassContext. The callbacks are called in order, and if one raises an exception, the rest will not be called.
◆ ListConfigs()
Get all supported configuration names and metadata, registered within the PassContext.
- Returns
- Map indexed by the config name, pointing to the metadata map as key-value
◆ operator->() [1/2]
mutable accessor.
- Returns
- mutable access pointer.
◆ operator->() [2/2]
const accessor.
- Returns
- const access pointer.
◆ PassEnabled()
bool tvm::transform::PassContext::PassEnabled |
( |
const PassInfo & |
info | ) |
const |
Check whether a pass is enabled.
- Parameters
-
info | The pass information. |
- Returns
- true if the pass is enabled. Otherwise, false.
◆ RegisterConfigOption()
template<typename ValueType >
static uint32_t tvm::transform::PassContext::RegisterConfigOption |
( |
const char * |
key | ) |
|
|
inlinestatic |
Register a valid configuration option and its ValueType for validation.
- Parameters
-
key | The configuration key. |
- Template Parameters
-
ValueType | The value type to be registered |
◆ Internal
◆ With< PassContext >
The documentation for this class was generated from the following file: