You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/08/24 13:05:09 UTC

[GitHub] [tvm] kparzysz-quic commented on a diff in pull request #12509: [Target] Add target_device_type attribute to override default device_type

kparzysz-quic commented on code in PR #12509:
URL: https://github.com/apache/tvm/pull/12509#discussion_r953776108


##########
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:
   This function will check the attribute first, and if it's not set, it will return the default.  It also shortens the invocation of `GetAttr`.  Let me know what you'd prefer.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org