|
tvm
|
Classes | |
| class | PassContextNode |
| PassContextNode contains the information that a pass can rely on, such as analysis results. More... | |
| class | PassContext |
| PassContext that is used to configure the pass behavior. More... | |
| class | PassInfoNode |
| Meta data that will be used to help optimization and analysis. More... | |
| class | PassInfo |
| Managed reference class for PassInfoNode. More... | |
| class | PassNode |
| PassNode is the base type of differnt types of optimization passes. It is designed as a pure class and implemented by different pass subclasses at different granularity of Relax nodes. More... | |
| class | Pass |
| class | SequentialNode |
| The SequentialNode contains a set of passes that transform Relax programs from one AST to another semantically equivalent one. More... | |
| class | Sequential |
Functions | |
| template<typename TConfig > | |
| TConfig | PassConfigWithDefaults () |
| Create a pass-config object with all default values, using the reflection defaults. More... | |
| Pass | CreateModulePass (std::function< IRModule(IRModule, PassContext)> pass_func, int opt_level, ffi::String name, ffi::Array< ffi::String > required, bool traceable=false) |
| Pass | PrintIR (ffi::String header="") |
| A special trace pass that prints the header and IR to LOG(INFO). More... | |
| ffi::Error | EnrichPassErrorWithContext (const ffi::Error &err, const IRModule &mod, ffi::String pass_name, ffi::Optional< GlobalVar > func=ffi::Optional< GlobalVar >(std::nullopt)) |
| Enrich a pass-time error with a TVMScript-rendered, underlined source location derived from the error's embedded VisitErrorContext. More... | |
| Pass tvm::transform::CreateModulePass | ( | std::function< IRModule(IRModule, PassContext)> | pass_func, |
| int | opt_level, | ||
| ffi::String | name, | ||
| ffi::Array< ffi::String > | required, | ||
| bool | traceable = false |
||
| ) |
| ffi::Error tvm::transform::EnrichPassErrorWithContext | ( | const ffi::Error & | err, |
| const IRModule & | mod, | ||
| ffi::String | pass_name, | ||
| ffi::Optional< GlobalVar > | func = ffi::Optional< GlobalVar >(std::nullopt) |
||
| ) |
Enrich a pass-time error with a TVMScript-rendered, underlined source location derived from the error's embedded VisitErrorContext.
Returns an ffi::Error that preserves err's kind, original message, and backtrace, and appends the failing pass name plus the offending location rendered as TVMScript (the whole mod, or local to func when provided). The returned error drops the VisitErrorContext payload, so an outer catch that re-enriches finds no context and returns the error unchanged.
Pure and total: never throws; returns err unchanged when there is no context, the path is unresolvable, or rendering fails.
| err | The error thrown by the pass body. |
| mod | The IRModule the pass ran on (the access-path root, or the container of func when func is provided). |
| pass_name | The name of the failing pass, shown in the message. |
| func | When set, resolve and render the location local to mod->functions[func]; otherwise use the whole module. |
|
inline |
Create a pass-config object with all default values, using the reflection defaults.
| TConfig | the ObjectRef type to be created. |
| Pass tvm::transform::PrintIR | ( | ffi::String | header = "" | ) |
A special trace pass that prints the header and IR to LOG(INFO).
| header | The header to be attached to the output. |