Class Target#

Inheritance Relationships#

Base Type#

  • public ffi::ObjectRef

Class Documentation#

class Target : public ffi::ObjectRef#

Managed reference class to TargetObj.

See also

TargetObj

Public Types

using ContainerType = TargetObj#

Public Functions

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

Construct a Target given a string.

Parameters:

tag_or_config_or_target_str – the string to parse for target

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

Construct a Target using a JSON-like configuration.

Parameters:

config – The JSON-like configuration for target

inline explicit Target(Target target, ffi::Optional<Target> host)#

Construct a Target given target and host.

Parameters:
  • target – The Target typed object with host field undefined for target

  • host – The Target typed object for target host

inline explicit Target(ffi::UnsafeInit tag, ffi::ObjectPtr<TargetObj> n)#
inline explicit Target(::tvm::ffi::UnsafeInit tag)#
inline __PtrType operator->() const#
inline __PtrType get() const#
inline Target WithoutHost() const#
Returns:

The target with the host stripped out

Public Static Functions

static ffi::Optional<Target> Current(bool allow_not_defined = true)#

Get the current target context from thread local storage.

Parameters:

allow_not_defined – If the context stack is empty and this is set to true, std::nullopt will be returned. Otherwise, an empty context stack will cause a runtime error.

Returns:

The target that is the current context. The result may be absent if allow_not_defined is true.

static Target WithHost(const Target &target, const ffi::Optional<Target> &host)#