#include <stdio.h>#include <iostream>#include <sstream>#include <string>#include <list>#include <map>#include "floats.hh"#include "smartpointer.hh"#include "klass.hh"#include "uitree.hh"#include "Text.hh"#include "signals.hh"Go to the source code of this file.
Defines | |
| #define | WORK_STEALING_INDEX 0 |
| #define | LAST_TASK_INDEX 1 |
| #define | START_TASK_INDEX LAST_TASK_INDEX + 1 |
| #define | START_TASK_MAX 2 |
Functions | |
| void | tab (int n, ostream &fout) |
| void | printlines (int n, list< string > &lines, ostream &fout) |
| Print a list of lines. | |
| void | printdecllist (int n, const string &decl, list< string > &content, ostream &fout) |
| Print a list of elements (e1, e2,. | |
| bool | isElement (const set< Loop * > &S, Loop *l) |
| static void | computeUseCount (Loop *l) |
| Compute how many time each loop is used in a DAG. | |
| static void | groupSeqLoops (Loop *l) |
| Group together sequences of loops. | |
| static bool | nonRecursiveLevel (const lset &L) |
| returns true if all the loops are non recursive | |
| static void | merge (set< string > &dst, set< string > &src) |
Variables | |
| bool | gVectorSwitch |
| bool | gDeepFirstSwitch |
| bool | gOpenMPSwitch |
| bool | gSchedulerSwitch |
| int | gVecSize |
| bool | gUIMacroSwitch |
| int | gVectorLoopVariant |
| bool | gGroupTaskSwitch |
| map< Tree, set< Tree > > | gMetaDataSet |
| static int | gTaskCount = 0 |
| #define LAST_TASK_INDEX 1 |
Definition at line 280 of file klass.cpp.
Referenced by Klass::buildTasksList().
| #define START_TASK_INDEX LAST_TASK_INDEX + 1 |
Definition at line 281 of file klass.cpp.
Referenced by Klass::buildTasksList(), and Klass::printComputeMethodScheduler().
| #define START_TASK_MAX 2 |
Definition at line 283 of file klass.cpp.
Referenced by Klass::buildTasksList().
| static void computeUseCount | ( | Loop * | l | ) | [static] |
Compute how many time each loop is used in a DAG.
Definition at line 245 of file klass.cpp.
References Loop::fBackwardLoopDependencies, and Loop::fUseCount.
Referenced by Klass::buildTasksList(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), and Klass::printLoopGraphVector().
00246 { 00247 l->fUseCount++; 00248 if (l->fUseCount == 1) { 00249 for (lset::iterator p =l->fBackwardLoopDependencies.begin(); p!=l->fBackwardLoopDependencies.end(); p++) { 00250 computeUseCount(*p); 00251 } 00252 } 00253 }
| static void groupSeqLoops | ( | Loop * | l | ) | [static] |
Group together sequences of loops.
Definition at line 258 of file klass.cpp.
References Loop::concat(), Loop::fBackwardLoopDependencies, and Loop::fUseCount.
Referenced by Klass::buildTasksList(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), and Klass::printLoopGraphVector().
00259 { 00260 int n = l->fBackwardLoopDependencies.size(); 00261 if (n==0) { 00262 return; 00263 } else if (n==1) { 00264 Loop* f = *(l->fBackwardLoopDependencies.begin()); 00265 if (f->fUseCount == 1) { 00266 l->concat(f); 00267 groupSeqLoops(l); 00268 } else { 00269 groupSeqLoops(f); 00270 } 00271 return; 00272 } else if (n > 1) { 00273 for (lset::iterator p =l->fBackwardLoopDependencies.begin(); p!=l->fBackwardLoopDependencies.end(); p++) { 00274 groupSeqLoops(*p); 00275 } 00276 } 00277 }
Definition at line 216 of file klass.cpp.
Referenced by Klass::printLoopDeepFirst(), and ppsig::printrec().
| static void merge | ( | set< string > & | dst, | |
| set< string > & | src | |||
| ) | [static] |
Definition at line 1105 of file klass.cpp.
Referenced by Klass::collectIncludeFile(), and Klass::collectLibrary().
01106 { 01107 set<string>::iterator i; 01108 for (i = src.begin(); i != src.end(); i++) dst.insert(*i); 01109 }
| static bool nonRecursiveLevel | ( | const lset & | L | ) | [static] |
returns true if all the loops are non recursive
Definition at line 498 of file klass.cpp.
Referenced by Klass::printLastLoopLevelScheduler(), Klass::printLoopLevelOpenMP(), and Klass::printLoopLevelScheduler().
00499 { 00500 for (lset::const_iterator p =L.begin(); p!=L.end(); p++) { 00501 if ((*p)->fIsRecursive) return false; 00502 } 00503 return true; 00504 }
| void printdecllist | ( | int | n, | |
| const string & | decl, | |||
| list< string > & | content, | |||
| ostream & | fout | |||
| ) |
Print a list of elements (e1, e2,.
..)
Definition at line 142 of file klass.cpp.
References tab().
Referenced by Klass::printComputeMethodOpenMP().
00143 { 00144 if (!content.empty()) { 00145 list<string>::iterator s; 00146 fout << "\\"; 00147 tab(n, fout); fout << decl; 00148 string sep = "("; 00149 for (s = content.begin(); s != content.end(); s++) { 00150 fout << sep << *s; 00151 sep = ", "; 00152 } 00153 fout << ')'; 00154 } 00155 }
| void printlines | ( | int | n, | |
| list< string > & | lines, | |||
| ostream & | fout | |||
| ) |
Print a list of lines.
Definition at line 131 of file klass.cpp.
References tab().
Referenced by Klass::printComputeMethodOpenMP(), Klass::printComputeMethodScalar(), Klass::printComputeMethodScheduler(), Klass::printComputeMethodVectorFaster(), Klass::printComputeMethodVectorSimple(), Loop::println(), SigFloatGenKlass::println(), SigIntGenKlass::println(), Klass::println(), and Loop::printoneln().
00132 { 00133 list<string>::iterator s; 00134 for (s = lines.begin(); s != lines.end(); s++) { 00135 tab(n, fout); fout << *s; 00136 } 00137 }
| void tab | ( | int | n, | |
| ostream & | fout | |||
| ) |
Definition at line 63 of file klass.cpp.
Referenced by Klass::printComputeMethodOpenMP(), Klass::printComputeMethodScalar(), Klass::printComputeMethodScheduler(), Klass::printComputeMethodVectorFaster(), Klass::printComputeMethodVectorSimple(), printdecllist(), Klass::printLastLoopLevelScheduler(), printlines(), Loop::println(), SigFloatGenKlass::println(), SigIntGenKlass::println(), Klass::println(), Klass::printLoopDeepFirst(), Klass::printLoopGraphInternal(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), Klass::printLoopGraphVector(), Klass::printLoopLevelOpenMP(), Klass::printMetadata(), Loop::printoneln(), and Klass::printOneLoopScheduler().
| bool gDeepFirstSwitch |
Definition at line 132 of file main.cpp.
Referenced by Klass::printLoopGraphVector(), and process_cmdline().
| bool gGroupTaskSwitch |
Definition at line 138 of file main.cpp.
Referenced by Klass::buildTasksList(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), Klass::printLoopGraphVector(), and process_cmdline().
| map<Tree, set<Tree> > gMetaDataSet |
| bool gOpenMPSwitch |
Definition at line 136 of file main.cpp.
Referenced by Klass::printComputeMethod(), Klass::printIncludeFile(), and process_cmdline().
| bool gSchedulerSwitch |
int gTaskCount = 0 [static] |
Definition at line 61 of file klass.cpp.
Referenced by Klass::buildTasksList(), Klass::printComputeMethodScheduler(), Klass::printLastLoopLevelScheduler(), and Klass::printOneLoopScheduler().
| bool gUIMacroSwitch |
Definition at line 140 of file main.cpp.
Referenced by Klass::println(), and process_cmdline().
Definition at line 134 of file main.cpp.
Referenced by Klass::printComputeMethod(), and process_cmdline().
| bool gVectorSwitch |
Definition at line 131 of file main.cpp.
Referenced by main(), Klass::printComputeMethod(), Klass::printLoopGraphInternal(), Klass::printLoopGraphVector(), and process_cmdline().
1.6.3