junrushao1994 commented on a change in pull request #6369:
URL: https://github.com/apache/incubator-tvm/pull/6369#discussion_r485272049
##########
File path: src/target/target.cc
##########
@@ -225,35 +325,52 @@ Optional<String> TargetNode::StringifyAttrsToRaw(const
Map<String, ObjectRef>& a
return JoinString(result, ' ');
}
-Target Target::CreateTarget(const std::string& name, const
std::vector<std::string>& options) {
- TargetKind kind = TargetKind::Get(name);
- ObjectPtr<TargetNode> target = make_object<TargetNode>();
- target->kind = kind;
- // tag is always empty
- target->tag = "";
- // parse attrs
- target->attrs = target->ParseAttrsFromRaw(options);
- String device_name = target->GetAttr<String>("device", "").value();
- // set up keys
- {
- std::vector<String> keys;
- // user provided keys
- if (Optional<Array<String>> user_keys =
target->GetAttr<Array<String>>("keys")) {
- keys = std::vector<String>(user_keys.value().begin(),
user_keys.value().end());
- target->attrs.erase("keys");
- }
- // add `device_name`
- if (!device_name.empty()) {
- keys.push_back(device_name);
+const std::string& TargetNode::str() const {
Review comment:
I tried to deprecate this, but only to find out that it has bunch of
dependencies. For example, autotvm logs, target structural equality used
everywhere in the codebase, etc. Let's make a note here and try to deprecate it
in the future :-)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]