Class TargetObj#
Defined in File target.h
Inheritance Relationships#
Base Type#
public ffi::Object
Class Documentation#
-
class TargetObj : public ffi::Object#
Compilation target.
See also
Public Functions
-
inline explicit TargetObj(TargetKind kind)#
-
inline explicit TargetObj(ffi::UnsafeInit tag)#
-
ffi::String str() const#
The JSON string representation of the target.
- Returns:
JSON string of the target configuration (e.g. {“kind”: “llvm”, “mcpu”: “cortex-a53”})
-
ffi::Map<ffi::String, ffi::Any> ToConfig() const#
- Returns:
Export target to JSON-like configuration
-
inline ffi::Optional<Target> GetHost() const#
- Returns:
The ffi::Optional<Target> typed target host of the TargetObj
-
inline int GetTargetDeviceType() const#
- Returns:
The device type for this target
-
inline bool HasKey(const ffi::String &query_key) const#
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::keyscontains the specified key, False otherwise.
-
template<typename TObjectRef>
inline 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 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
-
template<typename TObjectRef>
inline ffi::Optional<TObjectRef> GetAttr(const std::string &attr_key, TObjectRef default_value) const# 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
Public Members
-
TargetKind kind#
The kind of the target device.
-
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).
-
inline explicit TargetObj(TargetKind kind)#