24 #ifndef TVM_TARGET_TAG_H_ 25 #define TVM_TARGET_TAG_H_ 44 v->Visit(
"name", &name);
45 v->Visit(
"config", &config);
48 static constexpr
const char*
_type_key =
"TargetTag";
53 uint32_t AttrRegistryIndex()
const {
return index_; }
55 String AttrRegistryName()
const {
return name; }
59 template <
typename,
typename>
121 explicit TargetTagRegEntry(uint32_t reg_index) : tag_(make_object<TargetTagNode>()) {
122 tag_->index_ = reg_index;
124 template <
typename,
typename>
130 tag_->config = std::move(config);
135 if (tag_->name.empty()) {
141 #define TVM_TARGET_TAG_REGISTER_VAR_DEF \ 142 static DMLC_ATTRIBUTE_UNUSED ::tvm::TargetTagRegEntry& __make_##TargetTag 149 #define TVM_REGISTER_TARGET_TAG(TargetTagName) \ 150 TVM_STR_CONCAT(TVM_TARGET_TAG_REGISTER_VAR_DEF, __COUNTER__) = \ 151 ::tvm::TargetTagRegEntry::RegisterOrGet(TargetTagName).set_name() 155 #endif // TVM_TARGET_TAG_H_ void VisitAttrs(AttrVisitor *v)
Definition: tag.h:43
TargetTagRegEntry & set_name()
Set name of the TargetTag to be the same as registry if it is empty.
Definition: tag.h:134
Definitions and helper macros for IR/AST nodes.
Map< String, ObjectRef > config
Config map to generate the target.
Definition: tag.h:41
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
String name
Name of the target.
Definition: tag.h:39
base class of all object containers.
Definition: object.h:167
Definition: executor.h:43
Generic attribute map.
Definition: attr_registry_map.h:38
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
friend class TargetTagRegEntry
Definition: tag.h:63
Reference to string objects.
Definition: string.h:98
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:713
Managed reference class to TargetNode.
Definition: target.h:183
Base class of all object reference.
Definition: object.h:511
Attribute map used in registry.
Compilation target object.
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places.
Definition: map.h:1271
TargetTagRegEntry & set_config(Map< String, ObjectRef > config)
Set the config dict corresponding to the target tag.
Definition: tag.h:129
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
A target tag.
Definition: tag.h:36
Managed reference class to TargetTagNode.
Definition: tag.h:70
static constexpr const char * _type_key
Definition: tag.h:48
TVM_DECLARE_FINAL_OBJECT_INFO(TargetTagNode, Object)