tvm
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
tvm::TargetNode Class Reference

Compilation target. More...

#include <target.h>

Inheritance diagram for tvm::TargetNode:
Collaboration diagram for tvm::TargetNode:

Public Member Functions

const std::string & str () const
 The JSON string representation of the target. More...
 
ffi::Map< ffi::String, ffi::Any > ToConfig () const
 
ffi::Optional< TargetGetHost () const
 
int GetTargetDeviceType () const
 
bool HasKey (const std::string &query_key) const
 Check if the target contains a key. More...
 
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. More...
 
template<typename TObjectRef >
ffi::Optional< TObjectRef > GetAttr (const std::string &attr_key, TObjectRef default_value) const
 Get an entry from attrs of the target. More...
 
 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("target.Target", TargetNode, Object)
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

TargetKind kind
 The kind of the target device. More...
 
ffi::Optional< ObjectRef > host
 Target host information, must be Target type. More...
 
ffi::String tag
 Tag of the target, can be empty. More...
 
ffi::Array< ffi::String > keys
 Keys for this target. More...
 
ffi::Map< ffi::String, Any > attrs
 Collection of attributes (includes feature.* keys set by canonicalizer) More...
 

Static Public Attributes

static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode
 

Friends

class TargetInternal
 

Detailed Description

Compilation target.

See also
Target

Member Function Documentation

◆ GetAttr() [1/2]

template<typename TObjectRef >
ffi::Optional<TObjectRef> tvm::TargetNode::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
TObjectRefType of the attribute
Parameters
attr_keyThe name of the attribute key
default_valueThe value returned if the key is not present
Returns
An optional, std::nullopt if not found, otherwise the value found

◆ GetAttr() [2/2]

template<typename TObjectRef >
ffi::Optional<TObjectRef> tvm::TargetNode::GetAttr ( const std::string &  attr_key,
TObjectRef  default_value 
) const
inline

Get an entry from attrs of the target.

Template Parameters
TObjectRefType of the attribute
Parameters
attr_keyThe name of the attribute key
default_valueThe value returned if the key is not present
Returns
An optional, std::nullopt if not found, otherwise the value found

◆ GetHost()

ffi::Optional<Target> tvm::TargetNode::GetHost ( ) const
Returns
The ffi::Optional<Target> typed target host of the TargetNode

◆ GetTargetDeviceType()

int tvm::TargetNode::GetTargetDeviceType ( ) const
Returns
The device type for this target

◆ HasKey()

bool tvm::TargetNode::HasKey ( const std::string &  query_key) const

Check if the target contains a key.

Parameters
query_keyThe string name of the key to be checked
Returns
True if the target's TargetNode::keys contains the specified key, False otherwise.

◆ RegisterReflection()

static void tvm::TargetNode::RegisterReflection ( )
inlinestatic

◆ str()

const std::string& tvm::TargetNode::str ( ) const

The JSON string representation of the target.

Returns
JSON string of the target configuration (e.g. {"kind": "llvm", "mcpu": "cortex-a53"})

◆ ToConfig()

ffi::Map<ffi::String, ffi::Any> tvm::TargetNode::ToConfig ( ) const
Returns
Export target to JSON-like configuration

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::TargetNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "target.Target"  ,
TargetNode  ,
Object   
)

Friends And Related Function Documentation

◆ TargetInternal

friend class TargetInternal
friend

Member Data Documentation

◆ _type_s_eq_hash_kind

constexpr TVMFFISEqHashKind tvm::TargetNode::_type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode
staticconstexpr

◆ attrs

ffi::Map<ffi::String, Any> tvm::TargetNode::attrs

Collection of attributes (includes feature.* keys set by canonicalizer)

◆ host

ffi::Optional<ObjectRef> tvm::TargetNode::host

Target host information, must be Target type.

◆ keys

ffi::Array<ffi::String> tvm::TargetNode::keys

Keys for this target.

◆ kind

TargetKind tvm::TargetNode::kind

The kind of the target device.

◆ tag

ffi::String tvm::TargetNode::tag

Tag of the target, can be empty.


The documentation for this class was generated from the following file: