|
tvm
|
Namespaces | |
| namespace | op_attr |
| namespace | type_attr |
Classes | |
| class | AssertDoc |
| Reference type of AssertDocObj. More... | |
| class | AssertDocObj |
| Doc that represents assert statement. More... | |
| class | AssignDoc |
| Reference type of AssignDocObj. More... | |
| class | AssignDocObj |
| Doc that represents assign statement. More... | |
| class | AttrAccessDoc |
| Reference type of AttrAccessDocObj. More... | |
| class | AttrAccessDocObj |
| Doc that represents attribute access on another expression. More... | |
| class | BreakDoc |
| Reference type of BreakDocObj. More... | |
| class | BreakDocObj |
| Doc that represents break statement. More... | |
| class | CallDoc |
| Reference type of CallDocObj. More... | |
| class | CallDocObj |
| Doc that represents function call. More... | |
| class | ClassDoc |
| Reference type of ClassDocObj. More... | |
| class | ClassDocObj |
| Doc that represents class definition. More... | |
| class | CommentDoc |
| Reference type of CommentDocObj. More... | |
| class | CommentDocObj |
| Doc that represents comment. More... | |
| class | ContinueDoc |
| Reference type of ContinueDocObj. More... | |
| class | ContinueDocObj |
| Doc that represents continue statement. More... | |
| class | DictDoc |
| Reference type of DictDocObj. More... | |
| class | DictDocObj |
| Doc that represents dictionary literal. More... | |
| class | Doc |
| Reference type of DocObj. More... | |
| class | DocObj |
| The base class of all Doc. More... | |
| class | DocStringDoc |
| Reference type of DocStringDocObj. More... | |
| class | DocStringDocObj |
| Doc that represents docstring. More... | |
| class | DocTranslator |
| Owning reference to a hook translation context. More... | |
| class | DocTranslatorObj |
| Eager translation context shared by registered hooks. Hooks construct Docs, use explicit lexical scopes, and attach origins when emitting. More... | |
| struct | DocTranslatorVTable |
| Engine callbacks borrowed for the translator's lifetime. More... | |
| class | ExprDoc |
| Reference type of ExprDocObj. More... | |
| class | ExprDocObj |
| The base class of expression doc. More... | |
| class | ExprStmtDoc |
| Reference type of ExprStmtDocObj. More... | |
| class | ExprStmtDocObj |
| Doc that represents an expression as statement. More... | |
| class | ExprStringDoc |
| Reference type of ExprStringDocObj. More... | |
| class | ExprStringDocObj |
| Doc that renders an expression as a Python string literal. More... | |
| class | ForDoc |
| Reference type of ForDocObj. More... | |
| class | ForDocObj |
| Doc that represents for statement. More... | |
| class | FunctionDoc |
| Reference type of FunctionDocObj. More... | |
| class | FunctionDocObj |
| Doc that represents function definition. More... | |
| class | IdDoc |
| Reference type of IdDocObj. More... | |
| class | IdDocObj |
| Doc that represents identifier. More... | |
| class | IfDoc |
| Reference type of IfDocObj. More... | |
| class | IfDocObj |
| Doc that represent if-then-else statement. More... | |
| class | IndexDoc |
| Reference type of IndexDocObj. More... | |
| class | IndexDocObj |
| Doc that represents index access on another expression. More... | |
| class | LambdaDoc |
| Reference type of LambdaDocObj. More... | |
| class | LambdaDocObj |
| Doc that represents anonymous function. More... | |
| class | ListDoc |
| Reference type of ListDocObj. More... | |
| class | ListDocObj |
| Doc that represents list literal. More... | |
| class | LiteralDoc |
| Reference type of LiteralDocObj. More... | |
| class | LiteralDocObj |
| Doc that represents literal value. More... | |
| class | NamespaceDoc |
| An owning reference to a deferred script namespace. More... | |
| class | NamespaceDocObj |
| A reference to a canonical script namespace. More... | |
| class | OperationDoc |
| Reference type of OperationDocObj. More... | |
| class | OperationDocObj |
| Doc that represents operation. More... | |
| class | ReturnDoc |
| Reference type of ReturnDocObj. More... | |
| class | ReturnDocObj |
| Doc that represents return statement. More... | |
| class | ScopeDoc |
| Reference type of ScopeDocObj. More... | |
| class | ScopeDocObj |
| Doc that represents special scopes. More... | |
| class | SliceDoc |
| Reference type of SliceDocObj. More... | |
| class | SliceDocObj |
| Doc that represents slice in Index expression. More... | |
| class | StmtBlockDoc |
| Reference type of StmtBlockDocObj. More... | |
| class | StmtBlockDocObj |
| The container doc that holds a list of StmtDoc. More... | |
| class | StmtDoc |
| Reference type of StmtDocObj. More... | |
| class | StmtDocObj |
| The base class of statement doc. More... | |
| class | TupleDoc |
| Reference type of TupleDocObj. More... | |
| class | TupleDocObj |
| Doc that represents tuple literal. More... | |
| class | WhileDoc |
| Reference type of WhileDocObj. More... | |
| class | WhileDocObj |
| Doc that represents while statement. More... | |
Typedefs | |
| using | AccessPath = ffi::reflection::AccessPath |
| using | FDocTranslate = ffi::reflection::NativeFunctionView< ffi::Optional< ExprDoc >(DocTranslatorObj *translator, ffi::AnyView value, const ffi::Object *destination)> |
| Native translation hook with borrowed inputs and an owning result. | |
Functions | |
| ffi::Array< StmtDoc > | ToStmtDocArray (const ffi::List< Doc > &docs) |
| Convert collected Docs to statements in their original order. | |
| TVM_TIRX_DLL Doc | DocTranslate (ffi::AnyView ir, ffi::Dict< Doc, ffi::ObjectRef > *doc_origins=nullptr, ffi::Map< ffi::String, ffi::Any > extra_config={}) |
| Translate IR into a complete Doc including declarations and metadata setup. | |
| TVM_TIRX_DLL void | RegisterNamespaceAlias (const ffi::String &key, const ffi::String &default_alias) |
| Register a namespace alias during dialect static initialization. | |
| TVM_TIRX_DLL const ffi::Map< ffi::String, ffi::String > & | GetNamespaceAliases () |
| Read the registered namespace aliases. | |
| TVM_TIRX_DLL ffi::String | RedirectReprPrinterMethod (const ffi::ObjectRef &obj) |
| Render an IR object for its registered repr callback. | |
| TVM_TIRX_DLL ffi::Error | RedirectVisitErrorEnrichMethod (const ffi::Error &error, const ffi::ObjectRef &root) |
| Render visit-error context through the shared IR error renderer. | |
| template<typename ObjectType > | |
| void | RegisterScriptRepr () |
| Register TVMScript repr and visit-error rendering for ObjectType. | |
| TVM_TIRX_DLL IdDoc | VarDoc (DocTranslatorObj *d, const Var &var, bool explicit_def=true) |
| Allocate or retrieve a variable identifier and record its origin. | |
| TVM_TIRX_DLL ffi::Optional< ExprDoc > | VarDocTranslate (DocTranslatorObj *d, ffi::AnyView input, const ffi::Object *destination) |
| Translate a Var using the normal translation-hook signature. | |
| TVM_TIRX_DLL ExprDoc | AddMetadata (DocTranslatorObj *d, ffi::Any value) |
| Store a non-null value in the initialized metadata table. | |
| TVM_TIRX_DLL ExprDoc | RawCallDocTranslate (DocTranslatorObj *d, const CallObj *call, ffi::Optional< ffi::Array< ExprDoc > > translated_args=std::nullopt) |
| Emit an explicit Call constructor preserving all call fields. | |
| TVM_TIRX_DLL ffi::Optional< ExprDoc > | StandardCallDocTranslate (DocTranslatorObj *d, const CallObj *call) |
| Translate named Op-call syntax, falling back to an explicit call as needed. | |
| using tvm::script::printer::AccessPath = typedef ffi::reflection::AccessPath |
| using tvm::script::printer::FDocTranslate = typedef ffi::reflection::NativeFunctionView<ffi::Optional<ExprDoc>( DocTranslatorObj* translator, ffi::AnyView value, const ffi::Object* destination)> |
Native translation hook with borrowed inputs and an owning result.
| translator | Translation context borrowed for the duration of the call. |
| value | Input value borrowed for the duration of the call. |
| destination | Optional binding variable borrowed for the duration of the call. |
| TVM_TIRX_DLL ExprDoc tvm::script::printer::AddMetadata | ( | DocTranslatorObj * | d, |
| ffi::Any | value | ||
| ) |
Store a non-null value in the initialized metadata table.
| d | The translator with metadata state and identifier initialized. |
| value | The value, reusing an equal existing entry of the same type. |
| TVM_TIRX_DLL Doc tvm::script::printer::DocTranslate | ( | ffi::AnyView | ir, |
| ffi::Dict< Doc, ffi::ObjectRef > * | doc_origins = nullptr, |
||
| ffi::Map< ffi::String, ffi::Any > | extra_config = {} |
||
| ) |
Translate IR into a complete Doc including declarations and metadata setup.
| ir | The input IR value. |
| doc_origins | Optional output replaced with the owned origins only on success. |
| extra_config | The translation configuration snapshot. |
| TVM_TIRX_DLL const ffi::Map< ffi::String, ffi::String > & tvm::script::printer::GetNamespaceAliases | ( | ) |
Read the registered namespace aliases.
| TVM_TIRX_DLL ExprDoc tvm::script::printer::RawCallDocTranslate | ( | DocTranslatorObj * | d, |
| const CallObj * | call, | ||
| ffi::Optional< ffi::Array< ExprDoc > > | translated_args = std::nullopt |
||
| ) |
| TVM_TIRX_DLL ffi::String tvm::script::printer::RedirectReprPrinterMethod | ( | const ffi::ObjectRef & | obj | ) |
Render an IR object for its registered repr callback.
Tries to translate obj directly; on error falls back to a plain address string. Defined in src/script/printer/printer.cc so that <tvm/runtime/logging.h> is not pulled into this public header.
| TVM_TIRX_DLL ffi::Error tvm::script::printer::RedirectVisitErrorEnrichMethod | ( | const ffi::Error & | error, |
| const ffi::ObjectRef & | root | ||
| ) |
Render visit-error context through the shared IR error renderer.
| error | The original callback error, with traversal breadcrumbs. |
| root | The original structural operation root. |
| TVM_TIRX_DLL void tvm::script::printer::RegisterNamespaceAlias | ( | const ffi::String & | key, |
| const ffi::String & | default_alias | ||
| ) |
Register a namespace alias during dialect static initialization.
| key | The existing prefix configuration key, such as "tirx.prefix". |
| default_alias | The alias reserved before translation assigns variable names. |
| void tvm::script::printer::RegisterScriptRepr | ( | ) |
Register TVMScript repr and visit-error rendering for ObjectType.
| TVM_TIRX_DLL ffi::Optional< ExprDoc > tvm::script::printer::StandardCallDocTranslate | ( | DocTranslatorObj * | d, |
| const CallObj * | call | ||
| ) |
Translate named Op-call syntax, falling back to an explicit call as needed.
| d | The translator for the call's fields. |
| call | The typed call node; operation-specific hook dispatch belongs to its caller. |
Convert collected Docs to statements in their original order.
| docs | The Docs to convert, without modifying the collection. |
| ffi::Error | If a Doc is neither a StmtBlockDoc nor a StmtDoc. |
| TVM_TIRX_DLL IdDoc tvm::script::printer::VarDoc | ( | DocTranslatorObj * | d, |
| const Var & | var, | ||
| bool | explicit_def = true |
||
| ) |
Allocate or retrieve a variable identifier and record its origin.
| d | The translator owning the variable scope and origin table. |
| var | The variable to name. |
| explicit_def | True marks a definition and removes its pending entry; false denotes a reference. This helper does not emit a definition statement. |
| TVM_TIRX_DLL ffi::Optional< ExprDoc > tvm::script::printer::VarDocTranslate | ( | DocTranslatorObj * | d, |
| ffi::AnyView | input, | ||
| const ffi::Object * | destination | ||
| ) |
Translate a Var using the normal translation-hook signature.
| d | The translator owning variable definitions. |
| input | The Var or derived node to translate; other inputs are rejected. |
| destination | The optional destination object. |