klass.cpp File Reference

#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 dependency graph for klass.cpp:

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 Documentation

#define LAST_TASK_INDEX   1

Definition at line 308 of file klass.cpp.

Referenced by Klass::buildTasksList().

#define START_TASK_INDEX   LAST_TASK_INDEX + 1

Definition at line 309 of file klass.cpp.

Referenced by Klass::buildTasksList(), and Klass::printComputeMethodScheduler().

#define START_TASK_MAX   2

Definition at line 311 of file klass.cpp.

Referenced by Klass::buildTasksList().

#define WORK_STEALING_INDEX   0

Definition at line 307 of file klass.cpp.


Function Documentation

static void computeUseCount ( Loop l  )  [static]

Compute how many time each loop is used in a DAG.

Definition at line 273 of file klass.cpp.

References Loop::fBackwardLoopDependencies, and Loop::fUseCount.

Referenced by Klass::buildTasksList(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), and Klass::printLoopGraphVector().

00274 {
00275     l->fUseCount++;
00276     if (l->fUseCount == 1) {
00277         for (lset::iterator p =l->fBackwardLoopDependencies.begin(); p!=l->fBackwardLoopDependencies.end(); p++) {
00278             computeUseCount(*p);
00279         }
00280     }
00281 }

Here is the caller graph for this function:

static void groupSeqLoops ( Loop l  )  [static]

Group together sequences of loops.

Definition at line 286 of file klass.cpp.

References Loop::concat(), Loop::fBackwardLoopDependencies, and Loop::fUseCount.

Referenced by Klass::buildTasksList(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), and Klass::printLoopGraphVector().

00287 {
00288     int n = l->fBackwardLoopDependencies.size();
00289     if (n==0) {
00290         return;
00291     } else if (n==1) {
00292         Loop* f = *(l->fBackwardLoopDependencies.begin());
00293         if (f->fUseCount ==  1) {
00294             l->concat(f);
00295             groupSeqLoops(l);
00296         } else {
00297             groupSeqLoops(f);
00298         }
00299         return;
00300     } else if (n > 1) {
00301         for (lset::iterator p =l->fBackwardLoopDependencies.begin(); p!=l->fBackwardLoopDependencies.end(); p++) {
00302             groupSeqLoops(*p);
00303         }
00304     }
00305 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool isElement ( const set< Loop * > &  S,
Loop l 
) [inline]

Definition at line 244 of file klass.cpp.

Referenced by Klass::printLoopDeepFirst(), and ppsig::printrec().

00245 {
00246     return S.find(l)!= S.end();
00247 }

Here is the caller graph for this function:

static void merge ( set< string > &  dst,
set< string > &  src 
) [static]

Definition at line 1179 of file klass.cpp.

Referenced by Klass::collectIncludeFile(), and Klass::collectLibrary().

01180 {
01181     set<string>::iterator i;
01182     for (i = src.begin(); i != src.end(); i++)  dst.insert(*i);
01183 }

Here is the caller graph for this function:

static bool nonRecursiveLevel ( const lset L  )  [static]

returns true if all the loops are non recursive

Definition at line 561 of file klass.cpp.

Referenced by Klass::printLastLoopLevelScheduler(), Klass::printLoopLevelOpenMP(), and Klass::printLoopLevelScheduler().

00562 {
00563     for (lset::const_iterator p =L.begin(); p!=L.end(); p++) {
00564         if ((*p)->fIsRecursive) return false;
00565     }
00566     return true;
00567 }

Here is the caller graph for this function:

void printdecllist ( int  n,
const string &  decl,
list< string > &  content,
ostream &  fout 
)

Print a list of elements (e1, e2,.

..)

Definition at line 153 of file klass.cpp.

References tab().

Referenced by Klass::printComputeMethodOpenMP().

00154 {
00155     if (!content.empty()) {
00156         list<string>::iterator s;
00157         fout << "\\";
00158         tab(n, fout); fout << decl;
00159         string sep = "(";
00160         for (s = content.begin(); s != content.end(); s++) {
00161             fout << sep << *s;
00162             sep = ", ";
00163         }
00164         fout << ')';
00165     }
00166 }

Here is the call graph for this function:

Here is the caller graph for this function:

void printlines ( int  n,
list< string > &  lines,
ostream &  fout 
)

Print a list of lines.

Definition at line 142 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().

00143 {
00144     list<string>::iterator s;
00145     for (s = lines.begin(); s != lines.end(); s++) {
00146         tab(n, fout); fout << *s;
00147     }
00148 }

Here is the call graph for this function:

Here is the caller graph for this function:

void tab ( int  n,
ostream &  fout 
)

Variable Documentation

Definition at line 137 of file main.cpp.

Referenced by Klass::printLoopGraphVector(), and process_cmdline().

map<Tree, set<Tree> > gMetaDataSet

Definition at line 91 of file main.cpp.

Definition at line 141 of file main.cpp.

Referenced by Klass::printComputeMethod(), Klass::printIncludeFile(), and process_cmdline().

Definition at line 142 of file main.cpp.

Referenced by main(), Klass::printComputeMethod(), Klass::println(), and process_cmdline().

int gTaskCount = 0 [static]

Definition at line 145 of file main.cpp.

Referenced by Klass::println(), and process_cmdline().

int gVecSize

Definition at line 138 of file main.cpp.

Definition at line 139 of file main.cpp.

Referenced by Klass::printComputeMethod(), and process_cmdline().

Generated on Tue Aug 10 08:04:13 2010 for FAUST compiler by  doxygen 1.6.3