shingjan commented on a change in pull request #9306:
URL: https://github.com/apache/tvm/pull/9306#discussion_r731419220
##########
File path: src/tir/schedule/error.cc
##########
@@ -24,22 +24,31 @@ namespace tir {
String ScheduleError::RenderReport(const String& primitive) const {
IRModule mod = this->mod();
std::ostringstream os;
- os << "ScheduleError: An error occurred in the schedule primitive '" <<
primitive
- << "'.\n\nThe IR is:\n"
- << AsTVMScript(mod);
+
+ // get locations of interest
Array<ObjectRef> locs = LocationsOfInterest();
int n_locs = locs.size();
std::vector<String> roi_names;
roi_names.reserve(n_locs);
if (n_locs > 0) {
- os << "Regions of interest:\n";
for (const ObjectRef& obj : locs) {
String name = obj->GetTypeKey() + '#' + std::to_string(roi_names.size());
- os << name << "\n" << obj;
roi_names.emplace_back(std::move(name));
}
- os << "\n";
}
+
+ // print IR module
+ runtime::TypedPackedFunc<String(ObjectRef)> annotate =
+ runtime::TypedPackedFunc<String(ObjectRef)>([](const ObjectRef& expr) ->
String {
Review comment:
done. right now the annotate function returns the whole error message as
@junrushao1994 suggested that error message should also be appended after the
underline.
--
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]