Helper structure to register TargetKind.
More...
#include <target_kind.h>
Helper structure to register TargetKind.
- See also
- TVM_REGISTER_TARGET_KIND
◆ add_attr_option()
template<typename ValueType , typename... Traits>
| TargetKindRegEntry & tvm::TargetKindRegEntry::add_attr_option |
( |
const ffi::String & |
key, |
|
|
Traits &&... |
traits |
|
) |
| |
|
inline |
Register a valid configuration option and its ValueType for validation.
- Parameters
-
| key | The configuration key |
| traits | Optional traits (e.g. refl::DefaultValue, doc string, or raw default value) |
- Template Parameters
-
| ValueType | The value type to be registered |
| Traits | Optional trait types |
◆ ListTargetKindOptions()
| static ffi::Map<ffi::String, ffi::String> tvm::TargetKindRegEntry::ListTargetKindOptions |
( |
const TargetKind & |
kind | ) |
|
|
static |
Get all supported option names and types for a given Target kind.
- Returns
- Map of option name to type
◆ ListTargetKinds()
| static ffi::Array<ffi::String> tvm::TargetKindRegEntry::ListTargetKinds |
( |
| ) |
|
|
static |
List all the entry names in the registry.
- Returns
- The entry names.
◆ RegisterOrGet()
| static TargetKindRegEntry& tvm::TargetKindRegEntry::RegisterOrGet |
( |
const ffi::String & |
target_kind_name | ) |
|
|
static |
Register or get a new entry.
- Parameters
-
- Returns
- the corresponding entry.
◆ set_attr()
template<typename ValueType >
| TargetKindRegEntry & tvm::TargetKindRegEntry::set_attr |
( |
const ffi::String & |
attr_name, |
|
|
const ValueType & |
value, |
|
|
int |
plevel = 10 |
|
) |
| |
|
inline |
Register additional attributes to target_kind.
- Parameters
-
| attr_name | The name of the attribute. |
| value | The value to be set. |
| plevel | The priority level of this attribute, an higher priority level attribute will replace lower priority level attribute. Must be bigger than 0. |
Cannot set with same plevel twice in the code.
- Template Parameters
-
| ValueType | The type of the value to be set. |
◆ set_default_device_type()
Set DLPack's device_type the target.
- Parameters
-
◆ set_default_keys()
| TargetKindRegEntry & tvm::TargetKindRegEntry::set_default_keys |
( |
std::vector< ffi::String > |
keys | ) |
|
|
inline |
Set DLPack's device_type the target.
- Parameters
-
◆ set_name()
Set name of the TargetKind to be the same as registry if it is empty.
◆ set_target_canonicalizer()
Set the canonicalizer function applied upon target creation.
- Parameters
-
| canonicalizer | The target canonicalizer function. |
◆ AttrRegistry
template<typename , typename >
◆ TargetKind
The documentation for this class was generated from the following file: