Skip to content
Snippets Groups Projects
Commit eda5b71f authored by Daniel Maier's avatar Daniel Maier
Browse files

info2: restructure printing, add outer loops

parent 44366d14
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,18 @@
using perf_t = std::tuple<int, std::set<int>, int>;
std::ostream & operator << (std::ostream &out, const perf_t &p) {
auto [j, xx, k] = p;
out << j << ";";
for(auto x = xx.begin(); x != xx.end();) {
std::cout << *x;
++x;
if(x != xx.end())
std::cout << "_";
}
return out << ";" << k;
}
int main(int argc, char *argv[]) {
if(argc != 2) {
std::cerr << "usage: <SCOP>\n";
......@@ -41,9 +53,11 @@ int main(int argc, char *argv[]) {
return s;
};
/* adds the scop on all levels in the loop to a list */
auto add_scop = [&current_scop, &l, &j, &get_stmnts]() {
if(current_scop->domain->nb_output_dims > 0)
l.push_back(perf_t(j, get_stmnts(), current_scop->domain->nb_output_dims - 1));
for(unsigned i = 0; i < current_scop->domain->nb_output_dims; i++) {
l.push_back(perf_t(j, get_stmnts(), i));
}
};
while(s) {
......@@ -64,42 +78,27 @@ int main(int argc, char *argv[]) {
}
add_scop();
auto print_scop = [](perf_t &p) {
auto [j, xx, k] = p;
std::cout << "scop" << j << ";";
for(auto x = xx.begin(); x != xx.end();) {
std::cout << *x;
++x;
if(x != xx.end())
std::cout << "_";
}
std::cout << ";" << k << "\n";
};
std::vector<perf_t> list{ std::make_move_iterator(std::begin(l)),
std::make_move_iterator(std::end(l)) };
#if 0
std::cerr << "list size is now " << list.size() << "\n";
for(auto x : list) {
std::cerr << x << "\n";
}
return 0;
#endif
for(unsigned i = 1; i < pow(2, list.size()); i++) {
std::cout << "config;" << i << "\n";
for(unsigned j = 0; j < list.size(); j++) {
if ((i>>j)&1) {
print_scop(list[j]);
std::cout << list[j] << "\n";
}
}
std::cout << "\n";
}
/*
for(auto [j, xx, k]: list) {
std::cout << "scop" << j << ";";
for(auto x = xx.begin(); x != xx.end();) {
std::cout << *x;
++x;
if(x != xx.end())
std::cout << "_";
}
std::cout << ";" << k << "\n";
}
*/
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment