Registry of target configurations keyed by tag name.
More...
#include <target_tag_registry.h>
|
| using | Config = ffi::Map< ffi::String, ffi::Any > |
| |
Registry of target configurations keyed by tag name.
Register a tag during static initialization, then resolve it through Target:
TVM_FFI_STATIC_INIT_BLOCK() {
"my_cpu", {{"kind", ffi::String("llvm")}}, false);
}
static TVM_TIRX_DLL TargetTagRegistry * Global()
Return the process-wide registry.
TVM_TIRX_DLL Target AddTag(ffi::String name, Config config, bool override)
Register a target configuration under a tag name.
◆ Config
◆ AddTag()
Register a target configuration under a tag name.
- Parameters
-
| name | The tag name to register. |
| config | The target configuration, including its kind. |
| override | Whether to replace an existing registration; otherwise a duplicate is rejected. |
- Returns
- The target constructed from config.
◆ Get()
| TVM_TIRX_DLL ffi::Optional< Target > tvm::TargetTagRegistry::Get |
( |
const ffi::String & |
name | ) |
const |
Construct the target registered under a name.
- Parameters
-
| name | The tag name to look up. |
- Returns
- The constructed target, or nullopt if the name is unknown.
◆ GetConfig()
| TVM_TIRX_DLL ffi::Optional< Config > tvm::TargetTagRegistry::GetConfig |
( |
const ffi::String & |
name | ) |
const |
Return a tag's stored configuration without constructing a target.
- Parameters
-
| name | The tag name to look up. |
- Returns
- The configuration, or nullopt if the name is unknown.
◆ Global()
Return the process-wide registry.
◆ ListTags()
List all registered names and their constructed targets.
- Returns
- A map from tag names to targets; empty if no tags are registered.
The documentation for this class was generated from the following file: