|
10 | 10 |
|
11 | 11 | using namespace code_synthesis; |
12 | 12 | int main(int argc, char**argv) { |
13 | | - if(argc != 5 && argc != 9) { |
| 13 | + if(argc != 5 && argc != 9 && argc!=7 && argc!= 11) { |
14 | 14 | std::cerr << "Usage: synthDriver -src " |
15 | 15 | <<"<formatname>,<dataName> -dest <formatName>,<dataName> " |
16 | | - <<" [-fuse <fuse-list> -fuselevel <level>]\n"; |
| 16 | + <<" [-fuse <fuse-list> -fuselevel <level> ] [-known \"<space>\"] \n"; |
17 | 17 | return 0; |
18 | 18 | } |
19 | 19 | // Load preset optimizations |
@@ -213,7 +213,7 @@ int main(int argc, char**argv) { |
213 | 213 | SparseFormat* sourceFormat = NULL; |
214 | 214 | SparseFormat* destFormat = NULL; |
215 | 215 |
|
216 | | - |
| 216 | + Set* known = NULL; |
217 | 217 | while(currIndex < argc ) { |
218 | 218 | std::string argString (argv[currIndex]); |
219 | 219 | if(argString == "-src") { |
@@ -259,12 +259,19 @@ int main(int argc, char**argv) { |
259 | 259 | std::string level(argv[++currIndex]); |
260 | 260 | fuseLevel = std::stoi(level); |
261 | 261 | } |
262 | | - currIndex++; |
| 262 | + |
| 263 | + if (argString == "-known"){ |
| 264 | + std::string s(argv[++currIndex]); |
| 265 | + std::cout << "test: "<< s << "\n"; |
| 266 | + known = new Set(s); |
| 267 | + } |
| 268 | + |
| 269 | + currIndex++; |
263 | 270 | } |
264 | 271 | assert(sourceFormat && destFormat |
265 | 272 | && "Unsopported Source or Destination Format"); |
266 | 273 | CodeSynthesis* synth = new CodeSynthesis(sourceFormat, destFormat); |
267 | | - std::string code = synth->generateFullCode(fuseStmts,fuseLevel); |
| 274 | + std::string code = synth->generateFullCode(fuseStmts,fuseLevel,known); |
268 | 275 | std::ofstream fileOut; |
269 | 276 | fileOut.open("synth.h"); |
270 | 277 | fileOut << synth->GetSupportHeader(); |
|
0 commit comments