Temporary fluent builder for registering a target kind.
More...
#include <target_kind.h>
Temporary fluent builder for registering a target kind.
The registry retains the canonical kind after this builder is destroyed. Group related definitions inside TVM_FFI_STATIC_INIT_BLOCK():
TVM_FFI_STATIC_INIT_BLOCK() {
.def_option<ffi::String>("mcpu");
}
Temporary fluent builder for registering a target kind.
Definition target_kind.h:167
TargetKindDef & set_default_keys(std::vector< ffi::String > keys)
Set default target keys.
Definition target_kind.h:189
TargetKindDef & set_default_device_type(int device_type)
Set the default DLPack device type.
Definition target_kind.h:180
◆ TargetKindDef()
| tvm::TargetKindDef::TargetKindDef |
( |
const ffi::String & |
name | ) |
|
|
inlineexplicit |
Register or retrieve the canonical kind with this name.
- Parameters
-
◆ def_option()
template<typename ValueType , typename... Traits>
| TargetKindDef & tvm::TargetKindDef::def_option |
( |
const ffi::String & |
key, |
|
|
Traits &&... |
traits |
|
) |
| |
|
inline |
Declare a typed target option in the kind's ConfigSchema.
- Template Parameters
-
| ValueType | Canonical option value type. |
| Traits | Optional metadata or validator trait types. |
- Parameters
-
| key | Option name. |
| traits | Optional traits such as a default value or validator. |
- Returns
- This builder for chaining. Duplicate option names raise ValueError.
◆ set_default_device_type()
| TargetKindDef & tvm::TargetKindDef::set_default_device_type |
( |
int |
device_type | ) |
|
|
inline |
Set the default DLPack device type.
- Parameters
-
| device_type | DLPack device type. |
- Returns
- This builder for chaining.
◆ set_default_keys()
| TargetKindDef & tvm::TargetKindDef::set_default_keys |
( |
std::vector< ffi::String > |
keys | ) |
|
|
inline |
Set default target keys.
- Parameters
-
| keys | Default keys in priority order. |
- Returns
- This builder for chaining.
◆ set_target_canonicalizer()
Set the canonicalizer used when constructing targets of this kind.
- Parameters
-
| canonicalizer | Function from a validated config map to its canonical form. |
- Returns
- This builder for chaining. Also updates the kind's ConfigSchema.
The documentation for this class was generated from the following file: