lhutton1 commented on code in PR #16513:
URL: https://github.com/apache/tvm/pull/16513#discussion_r1483164278


##########
src/target/parsers/cpu.cc:
##########
@@ -28,7 +28,24 @@ namespace target {
 namespace parsers {
 namespace cpu {
 
+Optional<String> DetectSystemTriple() {
+  auto pf = tvm::runtime::Registry::Get("target.llvm_get_system_triple");
+  if (pf->defined()) {
+    return (*pf)();
+  }
+  return {};
+}
+
 TargetJSON ParseTarget(TargetJSON target) {
+  String kind = Downcast<String>(target.Get("kind"));
+  Optional<String> mtriple = Downcast<Optional<String>>(target.Get("mtriple"));
+  Optional<String> mcpu = Downcast<Optional<String>>(target.Get("mcpu"));
+
+  // Try to fill in the blanks by detecting target information from the system
+  if (kind == "llvm" && !mtriple.defined() && !mcpu.defined()) {
+    target.Set("mtriple", DetectSystemTriple().value_or(""));
+  }

Review Comment:
   After looking through the CI logs, I'm wondering if emitting a warning 
message is not the best idea here - there are way too many warnings. Perhaps it 
can be implemented in some driver of tvm instead, e.g. TVMC, and emitted once?



-- 
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]

Reply via email to