tvm
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
tvm::TargetTagRegistry Class Reference

Registry of target configurations keyed by tag name. More...

#include <target_tag_registry.h>

Collaboration diagram for tvm::TargetTagRegistry:

Public Types

using Config = ffi::Map< ffi::String, ffi::Any >
 

Public Member Functions

TVM_TIRX_DLL ffi::Optional< Target > Get (const ffi::String &name) const
 Construct the target registered under a name.
 
TVM_TIRX_DLL ffi::Optional< Config > GetConfig (const ffi::String &name) const
 Return a tag's stored configuration without constructing a target.
 
TVM_TIRX_DLL ffi::Map< ffi::String, Target > ListTags () const
 List all registered names and their constructed targets.
 
TVM_TIRX_DLL Target AddTag (ffi::String name, Config config, bool override)
 Register a target configuration under a tag name.
 

Static Public Member Functions

static TVM_TIRX_DLL TargetTagRegistry * Global ()
 Return the process-wide registry.
 

Detailed Description

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.

Member Typedef Documentation

◆ Config

using tvm::TargetTagRegistry::Config = ffi::Map<ffi::String, ffi::Any>

Member Function Documentation

◆ AddTag()

TVM_TIRX_DLL Target tvm::TargetTagRegistry::AddTag ( ffi::String  name,
Config  config,
bool  override 
)

Register a target configuration under a tag name.

Parameters
nameThe tag name to register.
configThe target configuration, including its kind.
overrideWhether 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
nameThe 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
nameThe tag name to look up.
Returns
The configuration, or nullopt if the name is unknown.

◆ Global()

static TVM_TIRX_DLL TargetTagRegistry * tvm::TargetTagRegistry::Global ( )
static

Return the process-wide registry.

◆ ListTags()

TVM_TIRX_DLL ffi::Map< ffi::String, Target > tvm::TargetTagRegistry::ListTags ( ) const

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: