Compilation target.
More...
#include <target.h>
Compilation target.
- See also
- Target
◆ Export()
- Returns
- Export target to JSON-like configuration
◆ GetAttr() [1/2]
template<typename TObjectRef >
Optional<TObjectRef> tvm::TargetNode::GetAttr |
( |
const std::string & |
attr_key, |
|
|
Optional< TObjectRef > |
default_value = Optional<TObjectRef>(nullptr) |
|
) |
| 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, NullOpt if not found, otherwise the value found
◆ GetAttr() [2/2]
template<typename TObjectRef >
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
-
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, NullOpt if not found, otherwise the value found
◆ GetFeature() [1/2]
template<typename TObjectRef >
Optional<TObjectRef> tvm::TargetNode::GetFeature |
( |
const std::string & |
attr_key, |
|
|
TObjectRef |
default_value |
|
) |
| const |
|
inline |
◆ GetFeature() [2/2]
template<typename TObjectRef >
Optional<TObjectRef> tvm::TargetNode::GetFeature |
( |
const std::string & |
feature_key, |
|
|
Optional< TObjectRef > |
default_value = Optional<TObjectRef>(nullptr) |
|
) |
| const |
|
inline |
Get a Target feature.
- Parameters
-
feature_key | The feature key. |
default_value | The default value if the key does not exist, defaults to nullptr. |
- Returns
- The result
- Template Parameters
-
TOBjectRef | the expected object type. |
- Exceptions
-
Error | if the key exists but the value does not match TObjectRef |
void GetTargetFeature(const Target& target) {
Bool has_feature = target->GetFeature<
Bool>(
"has_feature",
false).value();
}
Box< bool > Bool
Boxed version of C++ bool.
Definition: boxed_primitive.h:121
◆ GetHost()
- Returns
- The Optional<Target> typed target host of the TargetNode
◆ GetKeys()
std::vector<std::string> tvm::TargetNode::GetKeys |
( |
| ) |
const |
Get the keys for this target as a vector of string.
◆ GetLibs()
std::unordered_set<std::string> tvm::TargetNode::GetLibs |
( |
| ) |
const |
Get the keys for this target as an unordered_set of string.
◆ 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_key | The string name of the key to be checked |
- Returns
- True if the target's
TargetNode::keys
contains the specified key, False otherwise.
◆ SEqualReduce()
◆ SHashReduce()
void tvm::TargetNode::SHashReduce |
( |
SHashReducer |
hash_reduce | ) |
const |
◆ str()
const std::string& tvm::TargetNode::str |
( |
| ) |
const |
The raw string representation of the target.
- Returns
- the full device string to pass to codegen::Build
- Note
- It will be deprecated after the Target RFC is fully landed.
◆ ToDebugString()
String tvm::TargetNode::ToDebugString |
( |
| ) |
const |
Returns a human readable representation of Target
which includes all fields, especially the host. Useful for diagnostic messages and debugging.
TODO(mbs): The ReprPrinter version should perhaps switch to this form, however currently code depends on str() and << being the same.
◆ TVM_DECLARE_FINAL_OBJECT_INFO()
◆ VisitAttrs()
◆ TargetInternal
friend class TargetInternal |
|
friend |
◆ _type_has_method_sequal_reduce
constexpr const bool tvm::TargetNode::_type_has_method_sequal_reduce = true |
|
staticconstexpr |
◆ _type_has_method_shash_reduce
constexpr const bool tvm::TargetNode::_type_has_method_shash_reduce = true |
|
staticconstexpr |
◆ _type_key
constexpr const char* tvm::TargetNode::_type_key = "Target" |
|
staticconstexpr |
◆ attrs
Collection of attributes.
◆ features
◆ host
◆ keys
◆ kind
The kind of the target device.
◆ tag
Tag of the target, can be empty.
The documentation for this class was generated from the following file: