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>
128 tag_->index_ = reg_index;
130 template <
typename,
typename>
136 tag_->
config = std::move(config);
141 tag_->
config.Set(key, value);
152 #define TVM_TARGET_TAG_REGISTER_VAR_DEF \
153 static DMLC_ATTRIBUTE_UNUSED ::tvm::TargetTagRegEntry& __make_##TargetTag
160 #define TVM_REGISTER_TARGET_TAG(TargetTagName) \
161 TVM_STR_CONCAT(TVM_TARGET_TAG_REGISTER_VAR_DEF, __COUNTER__) = \
162 ::tvm::TargetTagRegEntry::RegisterOrGet(TargetTagName).set_name()
Attribute map used in registry.
Generic attribute map.
Definition: attr_registry_map.h:38
Definition: executor.h:43
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
A target tag.
Definition: tag.h:36
TVM_DECLARE_FINAL_OBJECT_INFO(TargetTagNode, Object)
static constexpr const char * _type_key
Definition: tag.h:48
Map< String, ObjectRef > config
Config map to generate the target.
Definition: tag.h:41
String name
Name of the target.
Definition: tag.h:39
void VisitAttrs(AttrVisitor *v)
Definition: tag.h:43
static TargetTagRegEntry & RegisterOrGet(const String &target_tag_name)
Register or get a new entry.
TargetTagRegEntry & set_name()
Set name of the TargetTag to be the same as registry if it is empty.
Definition: tag.h:145
TargetTagRegEntry & set_config(Map< String, ObjectRef > config)
Set the config dict corresponding to the target tag.
Definition: tag.h:135
TargetTagRegEntry & with_config(String key, ObjectRef value)
Add a key-value pair to the config dict.
Definition: tag.h:140
Managed reference class to TargetTagNode.
Definition: tag.h:70
static Target AddTag(String name, Map< String, ObjectRef > config, bool override)
Add a tag into the registry.
TVM_DEFINE_OBJECT_REF_METHODS(TargetTag, ObjectRef, TargetTagNode)
static Map< String, Target > ListTags()
List all names of the existing target tags.
static Optional< Target > Get(const String &target_tag_name)
Retrieve the Target given it the name of target tag.
Managed reference class to TargetNode.
Definition: target.h:200
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics,...
Definition: map.h:1271
Base class of all object reference.
Definition: object.h:519
ObjectPtr< Object > data_
Internal pointer that backs the reference.
Definition: object.h:605
base class of all object containers.
Definition: object.h:171
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Reference to string objects.
Definition: string.h:98
bool empty() const
Retun if the string is empty.
Definition: string.h:208
ObjectPtr< ArrayNode > make_object()
Definition: array.h:908
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Definitions and helper macros for IR/AST nodes.
Compilation target object.