tvm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tvm::transform::PassContextObj Class Reference

PassContextObj contains the information that a pass can rely on, such as analysis results. More...

#include <transform.h>

Inheritance diagram for tvm::transform::PassContextObj:
Collaboration diagram for tvm::transform::PassContextObj:

Public Member Functions

 PassContextObj ()=default
 
template<typename T >
ffi::Optional< T > GetConfig (const std::string &key) const
 Get a config value, returning an empty optional when the key is absent.
 
template<typename TConfig >
TConfig GetConfigOrDefault (const std::string &key) const
 Get a config object, constructing reflection defaults only when absent.
 
 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("transform.PassContext", PassContextObj, ffi::Object)
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

int opt_level {2}
 The default optimization level.
 
ffi::Array< ffi::String > required_pass
 The list of required passes.
 
ffi::Array< ffi::String > disabled_pass
 The list of disabled passes.
 
ffi::Map< ffi::String, Any > config
 Pass specific configurations.
 
ffi::Array< PassInstrument > instruments
 A list of pass instrument implementations.
 

Detailed Description

PassContextObj contains the information that a pass can rely on, such as analysis results.

See also
PassContext

Constructor & Destructor Documentation

◆ PassContextObj()

tvm::transform::PassContextObj::PassContextObj ( )
default

Member Function Documentation

◆ GetConfig()

template<typename T >
ffi::Optional< T > tvm::transform::PassContextObj::GetConfig ( const std::string &  key) const
inline

Get a config value, returning an empty optional when the key is absent.

Parameters
keyThe config key.
Template Parameters
TThe expected value type.
Exceptions
Errorif the key exists but the value does not match T.

◆ GetConfigOrDefault()

template<typename TConfig >
TConfig tvm::transform::PassContextObj::GetConfigOrDefault ( const std::string &  key) const
inline

Get a config object, constructing reflection defaults only when absent.

Parameters
keyThe config key.
Template Parameters
TConfigThe ObjectRef config type with reflection-defined defaults.
Returns
The configured object, or a fresh default object for this call.

◆ RegisterReflection()

static void tvm::transform::PassContextObj::RegisterReflection ( )
inlinestatic

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::transform::PassContextObj::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "transform.PassContext"  ,
PassContextObj  ,
ffi::Object   
)

Member Data Documentation

◆ config

ffi::Map<ffi::String, Any> tvm::transform::PassContextObj::config

Pass specific configurations.

◆ disabled_pass

ffi::Array<ffi::String> tvm::transform::PassContextObj::disabled_pass

The list of disabled passes.

◆ instruments

ffi::Array<PassInstrument> tvm::transform::PassContextObj::instruments

A list of pass instrument implementations.

◆ opt_level

int tvm::transform::PassContextObj::opt_level {2}

The default optimization level.

◆ required_pass

ffi::Array<ffi::String> tvm::transform::PassContextObj::required_pass

The list of required passes.


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