Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rm/2426 #2517

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Rm/2426 #2517

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/ast2ram/utility/SipsMetric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,18 @@ std::vector<std::size_t> SelingerProfileSipsMetric::getReordering(
/** Create a SIPS metric based on a given heuristic. */
std::unique_ptr<SipsMetric> SipsMetric::create(const std::string& heuristic, const TranslationUnit& tu) {
if (tu.global().config().has("auto-schedule")) {
return mk<SelingerProfileSipsMetric>(tu);
} else if (heuristic == "strict")
if (tu.getAnalysis<ast::analysis::ProfileUseAnalysis>().hasAutoSchedulerStats()) {
return mk<SelingerProfileSipsMetric>(tu);
} else {
// TODO: enable this, but if we do the scheduler tests won't run as they do now
#if 0
std::cerr << "WARNING: `--auto-schedule` cannot be used due to missing scheduler stats; falling back "
"to heuristic '"
<< heuristic << "'" << ::std::endl;
#endif
Comment on lines +316 to +321
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this TODO be addressed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should print the warning, but I'm not too familiar with CMAKE to make the updates to the test scripts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind merging as is?

}
}
if (heuristic == "strict")
return mk<StrictSips>(tu);
else if (heuristic == "all-bound")
return mk<AllBoundSips>(tu);
Expand Down
1 change: 1 addition & 0 deletions tests/scheduler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,5 @@ endfunction()
if (NOT MSVC)
souffle_add_scheduler_test(functionality)
souffle_add_scheduler_test(eqrel)
souffle_add_scheduler_test(bug2426)
endif()
9 changes: 9 additions & 0 deletions tests/scheduler/bug2426/bug2426.dl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.decl A(x:float)
.decl B(x: unsigned)
.decl res(a:float)
.output res

A(-1).
B(1).

res(a) :- B(x), A(a).
3 changes: 3 additions & 0 deletions tests/scheduler/bug2426/bug2426.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Warning: Variable x only occurs once in file bug2426.dl at line 9
res(a) :- B(x), A(a).
------------^---------
Empty file.
1 change: 1 addition & 0 deletions tests/scheduler/bug2426/res.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-1
Loading