|
FAUST compiler
0.9.9.6b8
|
#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"#include "ppsig.hh"#include "recursivness.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 | gOpenMPLoop |
| 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 318 of file klass.cpp.
Referenced by Klass::buildTasksList().
| #define START_TASK_INDEX LAST_TASK_INDEX + 1 |
Definition at line 319 of file klass.cpp.
Referenced by Klass::buildTasksList(), and Klass::printComputeMethodScheduler().
| #define START_TASK_MAX 2 |
Definition at line 321 of file klass.cpp.
Referenced by Klass::buildTasksList().
| #define WORK_STEALING_INDEX 0 |
| static void computeUseCount | ( | Loop * | l | ) | [static] |
Compute how many time each loop is used in a DAG.
Definition at line 283 of file klass.cpp.
References Loop::fBackwardLoopDependencies, and Loop::fUseCount.
Referenced by Klass::buildTasksList(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), and Klass::printLoopGraphVector().
{
l->fUseCount++;
if (l->fUseCount == 1) {
for (lset::iterator p =l->fBackwardLoopDependencies.begin(); p!=l->fBackwardLoopDependencies.end(); p++) {
computeUseCount(*p);
}
}
}

| static void groupSeqLoops | ( | Loop * | l | ) | [static] |
Group together sequences of loops.
Definition at line 296 of file klass.cpp.
References Loop::concat(), Loop::fBackwardLoopDependencies, and Loop::fUseCount.
Referenced by Klass::buildTasksList(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), and Klass::printLoopGraphVector().
{
int n = l->fBackwardLoopDependencies.size();
if (n==0) {
return;
} else if (n==1) {
Loop* f = *(l->fBackwardLoopDependencies.begin());
if (f->fUseCount == 1) {
l->concat(f);
groupSeqLoops(l);
} else {
groupSeqLoops(f);
}
return;
} else if (n > 1) {
for (lset::iterator p =l->fBackwardLoopDependencies.begin(); p!=l->fBackwardLoopDependencies.end(); p++) {
groupSeqLoops(*p);
}
}
}


Definition at line 254 of file klass.cpp.
Referenced by Klass::printLoopDeepFirst(), and ppsig::printrec().
{
return S.find(l)!= S.end();
}

| static void merge | ( | set< string > & | dst, |
| set< string > & | src | ||
| ) | [static] |
Definition at line 1195 of file klass.cpp.
Referenced by Klass::collectIncludeFile(), and Klass::collectLibrary().
{
set<string>::iterator i;
for (i = src.begin(); i != src.end(); i++) dst.insert(*i);
}

| static bool nonRecursiveLevel | ( | const lset & | L | ) | [static] |
returns true if all the loops are non recursive
Definition at line 571 of file klass.cpp.
Referenced by Klass::printLastLoopLevelScheduler(), Klass::printLoopLevelOpenMP(), and Klass::printLoopLevelScheduler().
{
for (lset::const_iterator p =L.begin(); p!=L.end(); p++) {
if ((*p)->fIsRecursive) return false;
}
return true;
}

| void printdecllist | ( | int | n, |
| const string & | decl, | ||
| list< string > & | content, | ||
| ostream & | fout | ||
| ) |
Print a list of elements (e1, e2,...)
Definition at line 163 of file klass.cpp.
References tab().
Referenced by Klass::printComputeMethodOpenMP().
{
if (!content.empty()) {
list<string>::iterator s;
fout << "\\";
tab(n, fout); fout << decl;
string sep = "(";
for (s = content.begin(); s != content.end(); s++) {
fout << sep << *s;
sep = ", ";
}
fout << ')';
}
}


| void printlines | ( | int | n, |
| list< string > & | lines, | ||
| ostream & | fout | ||
| ) |
Print a list of lines.
Definition at line 152 of file klass.cpp.
References tab().
Referenced by Klass::printComputeMethodOpenMP(), Klass::printComputeMethodScalar(), Klass::printComputeMethodScheduler(), Klass::printComputeMethodVectorFaster(), Klass::printComputeMethodVectorSimple(), Loop::println(), Klass::println(), SigIntGenKlass::println(), SigFloatGenKlass::println(), Loop::printoneln(), and Loop::printParLoopln().
{
list<string>::iterator s;
for (s = lines.begin(); s != lines.end(); s++) {
tab(n, fout); fout << *s;
}
}


| void tab | ( | int | n, |
| ostream & | fout | ||
| ) |
Definition at line 67 of file klass.cpp.
Referenced by Klass::printComputeMethodOpenMP(), Klass::printComputeMethodScalar(), Klass::printComputeMethodScheduler(), Klass::printComputeMethodVectorFaster(), Klass::printComputeMethodVectorSimple(), printdecllist(), Klass::printLastLoopLevelScheduler(), printlines(), Loop::println(), Klass::println(), SigIntGenKlass::println(), SigFloatGenKlass::println(), Klass::printLoopDeepFirst(), Klass::printLoopGraphInternal(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), Klass::printLoopGraphVector(), Klass::printLoopLevelOpenMP(), Klass::printMetadata(), Loop::printoneln(), Klass::printOneLoopScheduler(), and Loop::printParLoopln().
{
fout << '\n';
while (n--) fout << '\t';
}

| bool gDeepFirstSwitch |
Definition at line 138 of file main.cpp.
Referenced by Klass::printLoopGraphVector(), and process_cmdline().
| bool gGroupTaskSwitch |
Definition at line 145 of file main.cpp.
Referenced by Klass::buildTasksList(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), Klass::printLoopGraphVector(), and process_cmdline().
| map<Tree, set<Tree> > gMetaDataSet |
| bool gOpenMPLoop |
Definition at line 143 of file main.cpp.
Referenced by Klass::printLoopLevelOpenMP(), and process_cmdline().
| bool gOpenMPSwitch |
Definition at line 142 of file main.cpp.
Referenced by Klass::printComputeMethod(), Klass::printIncludeFile(), and process_cmdline().
| bool gSchedulerSwitch |
Definition at line 144 of file main.cpp.
Referenced by main(), Klass::printComputeMethod(), Klass::println(), and process_cmdline().
int gTaskCount = 0 [static] |
Definition at line 65 of file klass.cpp.
Referenced by Klass::buildTasksList(), Klass::printComputeMethodScheduler(), Klass::printLastLoopLevelScheduler(), and Klass::printOneLoopScheduler().
| bool gUIMacroSwitch |
Definition at line 147 of file main.cpp.
Referenced by Klass::println(), and process_cmdline().
Definition at line 140 of file main.cpp.
Referenced by Klass::printComputeMethod(), and process_cmdline().
| bool gVectorSwitch |
Definition at line 137 of file main.cpp.
Referenced by main(), Klass::printComputeMethod(), Klass::printLoopGraphInternal(), Klass::printLoopGraphVector(), and process_cmdline().
1.8.0