areusch commented on code in PR #12509:
URL: https://github.com/apache/tvm/pull/12509#discussion_r953079921
##########
include/tvm/target/target_kind.h:
##########
@@ -470,7 +470,8 @@ constexpr const char* kRelayToTIR = "RelayToTIR";
.add_attr_option<String>("model") \
.add_attr_option<Array<String>>("libs") \
.add_attr_option<Target>("host") \
- .add_attr_option<Integer>("from_device")
+ .add_attr_option<Integer>("from_device") \
+ .add_attr_option<Integer>("target_device_type")
Review Comment:
wondering if we should be producing this from e.g. processing `-mcpu` rather
than allowing it to be explicitly set by the user?
##########
src/target/target.cc:
##########
@@ -1042,6 +1049,9 @@
TVM_REGISTER_GLOBAL("target.TargetExitScope").set_body_typed(TargetInternal::Exi
TVM_REGISTER_GLOBAL("target.TargetCurrent").set_body_typed(Target::Current);
TVM_REGISTER_GLOBAL("target.TargetExport").set_body_typed(TargetInternal::Export);
TVM_REGISTER_GLOBAL("target.WithHost").set_body_typed(TargetInternal::WithHost);
+TVM_REGISTER_GLOBAL("target.TargetGetDeviceType").set_body_typed([](const
Target& target) {
Review Comment:
do we need this or can we just use the node attr accessor?
##########
include/tvm/target/target_kind.h:
##########
@@ -102,7 +102,7 @@ class TargetKindNode : public Object {
void VisitAttrs(AttrVisitor* v) {
v->Visit("name", &name);
- v->Visit("device_type", &device_type);
+ v->Visit("default_device_type", &default_device_type);
Review Comment:
this would be a convenient time to update a file e.g.
tests/release/PRERELEASE_NOTES.md to indicate an "api change." what do you
think about creating that file?
cc @driazati @tqchen @Mousius
##########
include/tvm/target/target_kind.h:
##########
@@ -364,7 +364,7 @@ inline TargetKindRegEntry&
TargetKindRegEntry::set_attr(const String& attr_name,
}
inline TargetKindRegEntry& TargetKindRegEntry::set_device_type(int
device_type) {
Review Comment:
should this change to set_default_device_type too?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]