Compilation target.
More...
#include <target.h>
|
| | TargetObj (TargetKind kind) |
| |
| | TargetObj (ffi::UnsafeInit tag) |
| |
| TVM_TIRX_DLL ffi::String | str () const |
| | The JSON string representation of the target.
|
| |
| TVM_TIRX_DLL ffi::Map< ffi::String, ffi::Any > | ToConfig () const |
| |
| ffi::Optional< Target > | GetHost () const |
| |
| int | GetTargetDeviceType () const |
| |
| bool | HasKey (const ffi::String &query_key) const |
| | Check if the target contains a key.
|
| |
| template<typename TObjectRef > |
| ffi::Optional< TObjectRef > | GetAttr (const std::string &attr_key, ffi::Optional< TObjectRef > default_value=ffi::Optional< TObjectRef >(std::nullopt)) const |
| | Get an entry from attrs of the target.
|
| |
| template<typename TObjectRef > |
| ffi::Optional< TObjectRef > | GetAttr (const std::string &attr_key, TObjectRef default_value) const |
| | Get an entry from attrs of the target.
|
| |
| template<typename T > |
| ffi::Optional< T > | GetAttr (ffi::reflection::AttrKey< T > key, ffi::Optional< typename ffi::reflection::AttrKey< T >::ValueType > default_value=std::nullopt) const |
| | Get an optional Target attribute using the value type declared by its key.
|
| |
| template<typename T > |
| ffi::Optional< T > | GetAttr (ffi::reflection::AttrKey< T > key, typename ffi::reflection::AttrKey< T >::ValueType default_value) const |
| | Use a default value when the typed Target attribute is absent.
|
| |
| | TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("target.Target", TargetObj, ffi::Object) |
| |
|
| TargetKind | kind |
| | The kind of the target device.
|
| |
| ffi::Optional< ffi::ObjectRef > | host |
| | Target host information, must be Target type.
|
| |
| ffi::String | tag |
| | Tag of the target, can be empty.
|
| |
| ffi::Array< ffi::String > | keys |
| | Keys for this target.
|
| |
| ffi::Map< ffi::String, Any > | attrs |
| | Collection of attributes (includes feature.* keys set by canonicalizer)
|
| |
Compilation target.
- See also
- Target
◆ TargetObj() [1/2]
◆ TargetObj() [2/2]
| tvm::TargetObj::TargetObj |
( |
ffi::UnsafeInit |
tag | ) |
|
|
inlineexplicit |
◆ GetAttr() [1/4]
template<typename TObjectRef >
| ffi::Optional< TObjectRef > tvm::TargetObj::GetAttr |
( |
const std::string & |
attr_key, |
|
|
ffi::Optional< TObjectRef > |
default_value = ffi::Optional<TObjectRef>(std::nullopt) |
|
) |
| const |
|
inline |
Get an entry from attrs of the target.
- Template Parameters
-
| TObjectRef | Type of the attribute |
- Parameters
-
| attr_key | The name of the attribute key |
| default_value | The value returned if the key is not present |
- Returns
- An optional, std::nullopt if not found, otherwise the value found
◆ GetAttr() [2/4]
template<typename TObjectRef >
| ffi::Optional< TObjectRef > tvm::TargetObj::GetAttr |
( |
const std::string & |
attr_key, |
|
|
TObjectRef |
default_value |
|
) |
| const |
|
inline |
Get an entry from attrs of the target.
- Template Parameters
-
| TObjectRef | Type of the attribute |
- Parameters
-
| attr_key | The name of the attribute key |
| default_value | The value returned if the key is not present |
- Returns
- An optional, std::nullopt if not found, otherwise the value found
◆ GetAttr() [3/4]
template<typename T >
| ffi::Optional< T > tvm::TargetObj::GetAttr |
( |
ffi::reflection::AttrKey< T > |
key, |
|
|
ffi::Optional< typename ffi::reflection::AttrKey< T >::ValueType > |
default_value = std::nullopt |
|
) |
| const |
|
inline |
Get an optional Target attribute using the value type declared by its key.
◆ GetAttr() [4/4]
template<typename T >
| ffi::Optional< T > tvm::TargetObj::GetAttr |
( |
ffi::reflection::AttrKey< T > |
key, |
|
|
typename ffi::reflection::AttrKey< T >::ValueType |
default_value |
|
) |
| const |
|
inline |
Use a default value when the typed Target attribute is absent.
◆ GetHost()
| ffi::Optional< Target > tvm::TargetObj::GetHost |
( |
| ) |
const |
|
inline |
- Returns
- The ffi::Optional<Target> typed target host of the TargetObj
◆ GetTargetDeviceType()
| int tvm::TargetObj::GetTargetDeviceType |
( |
| ) |
const |
|
inline |
- Returns
- The device type for this target
◆ HasKey()
| bool tvm::TargetObj::HasKey |
( |
const ffi::String & |
query_key | ) |
const |
|
inline |
Check if the target contains a key.
- Parameters
-
| query_key | The string name of the key to be checked |
- Returns
- True if the target's
TargetObj::keys contains the specified key, False otherwise.
◆ RegisterReflection()
| static void tvm::TargetObj::RegisterReflection |
( |
| ) |
|
|
inlinestatic |
◆ str()
The JSON string representation of the target.
- Returns
- JSON string of the target configuration (e.g. {"kind": "llvm", "mcpu": "cortex-a53"})
◆ ToConfig()
| TVM_TIRX_DLL ffi::Map< ffi::String, ffi::Any > tvm::TargetObj::ToConfig |
( |
| ) |
const |
- Returns
- Export target to JSON-like configuration
◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()
| tvm::TargetObj::TVM_FFI_DECLARE_OBJECT_INFO_FINAL |
( |
"target.Target" |
, |
|
|
TargetObj |
, |
|
|
ffi::Object |
|
|
) |
| |
◆ _type_mutable
| constexpr bool tvm::TargetObj::_type_mutable = true |
|
staticconstexpr |
◆ _type_s_eq_hash_kind
| constexpr TVMFFISEqHashKind tvm::TargetObj::_type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode |
|
staticconstexpr |
◆ attrs
| ffi::Map<ffi::String, Any> tvm::TargetObj::attrs |
Collection of attributes (includes feature.* keys set by canonicalizer)
◆ host
| ffi::Optional<ffi::ObjectRef> tvm::TargetObj::host |
◆ keys
| ffi::Array<ffi::String> tvm::TargetObj::keys |
◆ kind
The kind of the target device.
◆ tag
| ffi::String tvm::TargetObj::tag |
Tag of the target, can be empty.
The documentation for this class was generated from the following file:
- 3rdparty/tvm-tirx/include/tvm/target/target.h