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

info2: paraprox schemes

parent d9256e91
No related branches found
No related tags found
No related merge requests found
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
#include <set> #include <set>
#include <list> #include <list>
/* scop id, set of instructions, dimension */
using perf_t = std::tuple<int, std::set<int>, int>; using perf_t = std::tuple<int, std::set<int>, int>;
enum Strategy { baseline, permutation }; enum Strategy { pprows, ppcols, ppcenter, permutation };
std::ostream & operator << (std::ostream &out, const perf_t &p) { std::ostream & operator << (std::ostream &out, const perf_t &p) {
auto [j, xx, k] = p; auto [j, xx, k] = p;
...@@ -28,16 +29,23 @@ int main(int argc, char *argv[]) { ...@@ -28,16 +29,23 @@ int main(int argc, char *argv[]) {
/* parse arguments */ /* parse arguments */
if(argc != 3) { if(argc != 3) {
std::cerr << "usage: <strategy> <SCOP>\n" std::cerr << "usage: <strategy> <SCOP>\n"
<< " -p all permutations\n" << " --permutation all permutations\n"
<< " -b baseline\n\n"; << " --pprows paraprox rows\n"
<< " --ppcols paraprox cols\n"
<< " --ppcenter paraprox center\n"
<< "\n";
return -1; return -1;
} }
Strategy strategy; Strategy strategy;
if(!strcmp(argv[1], "-p")) if(!strcmp(argv[1], "--permutation"))
strategy = permutation; strategy = permutation;
else if(!strcmp(argv[1], "-b")) else if(!strcmp(argv[1], "--pprows"))
strategy = baseline; strategy = pprows;
else if(!strcmp(argv[1], "--ppcols"))
strategy = ppcols;
else if(!strcmp(argv[1], "--ppcenter"))
strategy = ppcenter;
else { else {
std::cerr << "invalid strategy\n"; std::cerr << "invalid strategy\n";
return -1; return -1;
...@@ -109,14 +117,30 @@ int main(int argc, char *argv[]) { ...@@ -109,14 +117,30 @@ int main(int argc, char *argv[]) {
std::cout << "\n"; std::cout << "\n";
} }
} }
else if(strategy == baseline) { else if(strategy == pprows) {
/* there is only one configuration */
std::cout << "config;1" << "\n";
int last_scop = -1; int last_scop = -1;
for(auto el : list) { for(auto el : list) {
if(last_scop != std::get<0>(el)) { if(last_scop != std::get<0>(el)) { /* using this we != we always pick the first element for each scop */
std::cout << el << "\n"; std::cout << el << "\n";
last_scop = std::get<0>(el); last_scop = std::get<0>(el);
} }
} }
std::cout << "\n";
}
else if(strategy == ppcols) {
std::cout << "list size " << list.size() << "\n";
/* there is only one configuration */
std::cout << "config;1" << "\n";
int last_scop = -1;
for(auto el : list) {
if(last_scop == std::get<0>(el)) { /* here we pick the *second* occurence for each scop */
std::cout << el << "\n";
}
last_scop = std::get<0>(el);
}
std::cout << "\n";
} }
#if 0 #if 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