tvm
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tvm::transform::PassContextNode Class Reference

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

#include <transform.h>

Inheritance diagram for tvm::transform::PassContextNode:
Collaboration diagram for tvm::transform::PassContextNode:

Public Member Functions

 PassContextNode ()=default
 
template<typename TObjectRef >
Optional< TObjectRef > GetConfig (const std::string &key, Optional< TObjectRef > default_value=Optional< TObjectRef >(std::nullopt)) const
 Get a config value from the pass context. More...
 
template<typename TObjectRef >
Optional< TObjectRef > GetConfig (const std::string &key, TObjectRef default_value) const
 
 TVM_DECLARE_FINAL_OBJECT_INFO (PassContextNode, Object)
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

int opt_level {2}
 The default optimization level. More...
 
Array< String > required_pass
 The list of required passes. More...
 
Array< String > disabled_pass
 The list of disabled passes. More...
 
Optional< DiagnosticContextdiag_ctx
 The diagnostic context. More...
 
Map< String, Any > config
 Pass specific configurations. More...
 
Array< instrument::PassInstrumentinstruments
 A list of pass instrument implementations. More...
 

Static Public Attributes

static constexpr const char * _type_key = "transform.PassContext"
 

Detailed Description

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

See also
PassContext

Constructor & Destructor Documentation

◆ PassContextNode()

tvm::transform::PassContextNode::PassContextNode ( )
default

Member Function Documentation

◆ GetConfig() [1/2]

template<typename TObjectRef >
Optional<TObjectRef> tvm::transform::PassContextNode::GetConfig ( const std::string &  key,
Optional< TObjectRef >  default_value = Optional<TObjectRef>(std::nullopt) 
) const
inline

Get a config value from the pass context.

Parameters
keyThe config key.
default_valueThe default value if the key does not exist, defaults to nullptr.
Returns
The result
Template Parameters
TOBjectRefthe expected object type.
Exceptions
Errorif the key exists but the value does not match TObjectRef.

◆ GetConfig() [2/2]

template<typename TObjectRef >
Optional<TObjectRef> tvm::transform::PassContextNode::GetConfig ( const std::string &  key,
TObjectRef  default_value 
) const
inline

◆ RegisterReflection()

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

◆ TVM_DECLARE_FINAL_OBJECT_INFO()

tvm::transform::PassContextNode::TVM_DECLARE_FINAL_OBJECT_INFO ( PassContextNode  ,
Object   
)

Member Data Documentation

◆ _type_key

constexpr const char* tvm::transform::PassContextNode::_type_key = "transform.PassContext"
staticconstexpr

◆ config

Map<String, Any> tvm::transform::PassContextNode::config

Pass specific configurations.

◆ diag_ctx

Optional<DiagnosticContext> tvm::transform::PassContextNode::diag_ctx
mutable

The diagnostic context.

◆ disabled_pass

Array<String> tvm::transform::PassContextNode::disabled_pass

The list of disabled passes.

◆ instruments

Array<instrument::PassInstrument> tvm::transform::PassContextNode::instruments

A list of pass instrument implementations.

◆ opt_level

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

The default optimization level.

◆ required_pass

Array<String> tvm::transform::PassContextNode::required_pass

The list of required passes.


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