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

Managed reference class to TargetNode. More...

#include <target.h>

Inheritance diagram for tvm::Target:
Collaboration diagram for tvm::Target:

Public Member Functions

 Target (std::nullptr_t)
 Construct a null Target. More...
 
 Target (const ffi::String &tag_or_config_or_target_str)
 Construct a Target given a string. More...
 
 Target (const ffi::Map< ffi::String, ffi::Any > &config)
 Construct a Target using a JSON-like configuration. More...
 
 Target (Target target, Target host)
 Construct a Target given target and host. More...
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (Target, ObjectRef, TargetNode)
 
Target WithoutHost () const
 

Static Public Member Functions

static tvm::Target Current (bool allow_not_defined=true)
 Get the current target context from thread local storage. More...
 
static Target WithHost (const Target &target, const Target &host)
 

Friends

class TargetInternal
 
class With< Target >
 

Detailed Description

Managed reference class to TargetNode.

See also
TargetNode

Constructor & Destructor Documentation

◆ Target() [1/4]

tvm::Target::Target ( std::nullptr_t  )
inlineexplicit

Construct a null Target.

◆ Target() [2/4]

tvm::Target::Target ( const ffi::String &  tag_or_config_or_target_str)
explicit

Construct a Target given a string.

Parameters
tag_or_config_or_target_strthe string to parse for target

◆ Target() [3/4]

tvm::Target::Target ( const ffi::Map< ffi::String, ffi::Any > &  config)
explicit

Construct a Target using a JSON-like configuration.

Parameters
configThe JSON-like configuration for target

◆ Target() [4/4]

tvm::Target::Target ( Target  target,
Target  host 
)
explicit

Construct a Target given target and host.

Parameters
targetThe Target typed object with host field undefined for target
hostThe Target typed object for target host

Member Function Documentation

◆ Current()

static tvm::Target tvm::Target::Current ( bool  allow_not_defined = true)
static

Get the current target context from thread local storage.

Parameters
allow_not_definedIf the context stack is empty and this is set to true, an undefined Target will be returned. Otherwise, an empty context stack will cause a runtime error.
Returns
The target that is the current context. The target may not be defined if allow_not_defined is true.

◆ TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE()

tvm::Target::TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE ( Target  ,
ObjectRef  ,
TargetNode   
)

◆ WithHost()

static Target tvm::Target::WithHost ( const Target target,
const Target host 
)
static

◆ WithoutHost()

Target tvm::Target::WithoutHost ( ) const
Returns
The target with the host stripped out

Friends And Related Function Documentation

◆ TargetInternal

friend class TargetInternal
friend

◆ With< Target >

friend class With< Target >
friend

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