FAUST compiler  0.9.9.6b8
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Klass Class Reference

#include <klass.hh>

Inheritance diagram for Klass:
Inheritance graph
[legend]
Collaboration diagram for Klass:
Collaboration graph
[legend]

Public Member Functions

 Klass (const string &name, const string &super, int numInputs, int numOutputs, bool __vec=false)
 
virtual ~Klass ()
 
void setParentKlass (Klass *parent)
 
KlassgetParentKlass ()
 
KlassgetTopParentKlass ()
 
string getFullClassName ()
 Returns the name of the class. More...
 
void openLoop (const string &size)
 Open a non-recursive loop on top of the stack of open loops. More...
 
void openLoop (Tree recsymbol, const string &size)
 Open a recursive loop on top of the stack of open loops. More...
 
void closeLoop (Tree sig)
 Close the top loop and either keep it or absorb it within its enclosing loop. More...
 
void setLoopProperty (Tree sig, Loop *l)
 Store the loop used to compute a signal. More...
 
bool getLoopProperty (Tree sig, Loop *&l)
 Returns the loop used to compute a signal. More...
 
const string & getClassName () const
 Returns the name of the class. More...
 
LooptopLoop ()
 
void buildTasksList ()
 
void addIncludeFile (const string &str)
 
void addLibrary (const string &str)
 
void rememberNeedPowerDef ()
 
void collectIncludeFile (set< string > &S)
 
void collectLibrary (set< string > &S)
 
void addSubKlass (Klass *son)
 
void addDeclCode (const string &str)
 
void addInitCode (const string &str)
 
void addStaticInitCode (const string &str)
 
void addStaticFields (const string &str)
 
void addUICode (const string &str)
 
void addUIMacro (const string &str)
 
void incUIActiveCount ()
 
void incUIPassiveCount ()
 
void addSharedDecl (const string &str)
 
void addFirstPrivateDecl (const string &str)
 
void addZone1 (const string &str)
 
void addZone2 (const string &str)
 
void addZone2b (const string &str)
 
void addZone2c (const string &str)
 
void addZone3 (const string &str)
 
void addPreCode (const string &str)
 
void addExecCode (const string &str)
 
void addPostCode (const string &str)
 
virtual void println (int n, ostream &fout)
 Print a full C++ class corresponding to a Faust dsp. More...
 
virtual void printComputeMethod (int n, ostream &fout)
 Print Compute() method according to the various switch. More...
 
virtual void printComputeMethodScalar (int n, ostream &fout)
 
virtual void printComputeMethodVectorFaster (int n, ostream &fout)
 Uses loops of constant gVecSize boundary in order to provide the C compiler with more optimisation opportunities. More...
 
virtual void printComputeMethodVectorSimple (int n, ostream &fout)
 Simple loop layout, generally less efficient than printComputeMethodVectorFaster. More...
 
virtual void printComputeMethodOpenMP (int n, ostream &fout)
 
virtual void printComputeMethodScheduler (int n, ostream &fout)
 
virtual void printLoopGraphScalar (int n, ostream &fout)
 Print the loop graph (scalar mode) More...
 
virtual void printLoopGraphVector (int n, ostream &fout)
 Print the loop graph (used for vector code) More...
 
virtual void printLoopGraphOpenMP (int n, ostream &fout)
 Print the loop graph as a serie of parallel loops. More...
 
virtual void printLoopGraphScheduler (int n, ostream &fout)
 Print the loop graph as a serie of parallel loops. More...
 
virtual void printLoopGraphInternal (int n, ostream &fout)
 Print the loop graph (used for internals classes) More...
 
virtual void printGraphDotFormat (ostream &fout)
 Print the loop graph in dot format. More...
 
virtual void printLoopDeepFirst (int n, ostream &fout, Loop *l, set< Loop * > &visited)
 Print a loop graph deep first. More...
 
virtual void printLastLoopLevelScheduler (int n, int lnum, const lset &L, ostream &fout)
 Print the 'level' of the loop graph as a set of parallel loops. More...
 
virtual void printLoopLevelScheduler (int n, int lnum, const lset &L, ostream &fout)
 Print the 'level' of the loop graph as a set of parallel loops. More...
 
virtual void printOneLoopScheduler (lset::const_iterator p, int n, ostream &fout)
 
virtual void printLoopLevelOpenMP (int n, int lnum, const lset &L, ostream &fout)
 Print the 'level' of the loop graph as a set of parallel loops. More...
 
virtual void printMetadata (int n, const map< Tree, set< Tree > > &S, ostream &fout)
 Print metadata declaration. More...
 
virtual void printIncludeFile (ostream &fout)
 Print the required include files. More...
 
virtual void printLibrary (ostream &fout)
 Print the required C++ libraries as comments in source code. More...
 
virtual void printAdditionalCode (ostream &fout)
 Print additional functions required by the generated code. More...
 
int inputs ()
 
int outputs ()
 

Protected Attributes

KlassfParentKlass
 Klass in which this Klass is embedded, void if toplevel Klass. More...
 
string fKlassName
 
string fSuperKlassName
 
int fNumInputs
 
int fNumOutputs
 
int fNumActives
 number of active controls in the UI (sliders, buttons, etc.) More...
 
int fNumPassives
 number of passive widgets in the UI (bargraphs, etc.) More...
 
set< string > fIncludeFileSet
 
set< string > fLibrarySet
 
list< Klass * > fSubClassList
 
list< string > fDeclCode
 
list< string > fStaticInitCode
 static init code for class constant tables More...
 
list< string > fStaticFields
 static fields after class More...
 
list< string > fInitCode
 
list< string > fUICode
 
list< string > fUIMacro
 
list< string > fSharedDecl
 shared declarations More...
 
list< string > fFirstPrivateDecl
 first private declarations More...
 
list< string > fZone1Code
 shared vectors More...
 
list< string > fZone2Code
 first private More...
 
list< string > fZone2bCode
 single once per block More...
 
list< string > fZone2cCode
 single once per block More...
 
list< string > fZone3Code
 private every sub block More...
 
LoopfTopLoop
 active loops currently open More...
 
property< Loop * > fLoopProperty
 loops used to compute some signals More...
 
bool fVec
 

Static Protected Attributes

static bool fNeedPowerDef = false
 true when faustpower definition is needed More...
 

Detailed Description

Definition at line 55 of file klass.hh.

Constructor & Destructor Documentation

Klass::Klass ( const string &  name,
const string &  super,
int  numInputs,
int  numOutputs,
bool  __vec = false 
)
inline

Definition at line 109 of file klass.hh.

110  : fParentKlass(0), fKlassName(name), fSuperKlassName(super), fNumInputs(numInputs), fNumOutputs(numOutputs),
111  fNumActives(0), fNumPassives(0),
112  fTopLoop(new Loop(0, "count")), fVec(__vec)
113  {}
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
int fNumInputs
Definition: klass.hh:69
int fNumActives
number of active controls in the UI (sliders, buttons, etc.)
Definition: klass.hh:71
bool fVec
Definition: klass.hh:105
int fNumPassives
number of passive widgets in the UI (bargraphs, etc.)
Definition: klass.hh:72
int fNumOutputs
Definition: klass.hh:70
Klass * fParentKlass
Klass in which this Klass is embedded, void if toplevel Klass.
Definition: klass.hh:66
const char * name(Symbol *sym)
Returns the name of a symbol.
Definition: symbol.hh:98
string fKlassName
Definition: klass.hh:67
string fSuperKlassName
Definition: klass.hh:68
Definition: loop.hh:52
virtual Klass::~Klass ( )
inlinevirtual

Definition at line 115 of file klass.hh.

115 {}

Member Function Documentation

void Klass::addDeclCode ( const string &  str)
inline

Definition at line 149 of file klass.hh.

Referenced by buildTasksList(), SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), and SchedulerCompiler::vectorLoop().

149 { fDeclCode.push_back(str); }
list< string > fDeclCode
Definition: klass.hh:79

Here is the caller graph for this function:

void Klass::addExecCode ( const string &  str)
inline

Definition at line 175 of file klass.hh.

Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), SchedulerCompiler::vectorLoop(), and VectorCompiler::vectorLoop().

175 { fTopLoop->addExecCode(str); }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
void addExecCode(const string &str)
add a line of C++ code
Definition: loop.cpp:91

Here is the caller graph for this function:

void Klass::addFirstPrivateDecl ( const string &  str)
inline

Definition at line 166 of file klass.hh.

Referenced by SchedulerCompiler::dlineLoop(), and VectorCompiler::dlineLoop().

166 { fFirstPrivateDecl.push_back(str); }
list< string > fFirstPrivateDecl
first private declarations
Definition: klass.hh:94

Here is the caller graph for this function:

void Klass::addIncludeFile ( const string &  str)
inline

Definition at line 137 of file klass.hh.

Referenced by Compiler::addIncludeFile().

137 { fIncludeFileSet.insert(str); }
set< string > fIncludeFileSet
Definition: klass.hh:74

Here is the caller graph for this function:

void Klass::addInitCode ( const string &  str)
inline

Definition at line 151 of file klass.hh.

Referenced by buildTasksList(), SchedulerCompiler::dlineLoop(), and VectorCompiler::dlineLoop().

151 { fInitCode.push_back(str); }
list< string > fInitCode
Definition: klass.hh:82

Here is the caller graph for this function:

void Klass::addLibrary ( const string &  str)
inline

Definition at line 139 of file klass.hh.

Referenced by Compiler::addLibrary().

139 { fLibrarySet.insert(str); }
set< string > fLibrarySet
Definition: klass.hh:75

Here is the caller graph for this function:

void Klass::addPostCode ( const string &  str)
inline

Definition at line 176 of file klass.hh.

Referenced by SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), and VectorCompiler::generateWaveform().

176 { fTopLoop->addPostCode(str); }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
void addPostCode(const string &str)
add a line of C++ post code
Definition: loop.cpp:101

Here is the caller graph for this function:

void Klass::addPreCode ( const string &  str)
inline

Definition at line 174 of file klass.hh.

Referenced by SchedulerCompiler::dlineLoop(), and VectorCompiler::dlineLoop().

174 { fTopLoop->addPreCode(str); }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
void addPreCode(const string &str)
add a line of C++ code pre code
Definition: loop.cpp:82

Here is the caller graph for this function:

void Klass::addSharedDecl ( const string &  str)
inline

Definition at line 165 of file klass.hh.

Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), SchedulerCompiler::vectorLoop(), and VectorCompiler::vectorLoop().

165 { fSharedDecl.push_back(str); }
list< string > fSharedDecl
shared declarations
Definition: klass.hh:93

Here is the caller graph for this function:

void Klass::addStaticFields ( const string &  str)
inline

Definition at line 155 of file klass.hh.

155 { fStaticFields.push_back(str); }
list< string > fStaticFields
static fields after class
Definition: klass.hh:81
void Klass::addStaticInitCode ( const string &  str)
inline

Definition at line 153 of file klass.hh.

153 { fStaticInitCode.push_back(str); }
list< string > fStaticInitCode
static init code for class constant tables
Definition: klass.hh:80
void Klass::addSubKlass ( Klass son)
inline

Definition at line 147 of file klass.hh.

147 { fSubClassList.push_back(son); }
list< Klass * > fSubClassList
Definition: klass.hh:77
void Klass::addUICode ( const string &  str)
inline

Definition at line 157 of file klass.hh.

Referenced by Compiler::generateUserInterfaceTree(), and Compiler::generateWidgetCode().

157 { fUICode.push_back(str); }
list< string > fUICode
Definition: klass.hh:83

Here is the caller graph for this function:

void Klass::addUIMacro ( const string &  str)
inline

Definition at line 159 of file klass.hh.

Referenced by Compiler::generateWidgetMacro().

159 { fUIMacro.push_back(str); }
list< string > fUIMacro
Definition: klass.hh:84

Here is the caller graph for this function:

void Klass::addZone1 ( const string &  str)
inline

Definition at line 168 of file klass.hh.

Referenced by VectorCompiler::dlineLoop(), and VectorCompiler::vectorLoop().

168 { fZone1Code.push_back(str); }
list< string > fZone1Code
shared vectors
Definition: klass.hh:96

Here is the caller graph for this function:

void Klass::addZone2 ( const string &  str)
inline

Definition at line 169 of file klass.hh.

Referenced by SchedulerCompiler::dlineLoop(), and VectorCompiler::dlineLoop().

169 { fZone2Code.push_back(str); }
list< string > fZone2Code
first private
Definition: klass.hh:97

Here is the caller graph for this function:

void Klass::addZone2b ( const string &  str)
inline

Definition at line 170 of file klass.hh.

170 { fZone2bCode.push_back(str); }
list< string > fZone2bCode
single once per block
Definition: klass.hh:98
void Klass::addZone2c ( const string &  str)
inline

Definition at line 171 of file klass.hh.

Referenced by buildTasksList().

171 { fZone2cCode.push_back(str); }
list< string > fZone2cCode
single once per block
Definition: klass.hh:99

Here is the caller graph for this function:

void Klass::addZone3 ( const string &  str)
inline

Definition at line 172 of file klass.hh.

Referenced by buildTasksList(), SchedulerCompiler::compileMultiSignal(), and VectorCompiler::compileMultiSignal().

172 { fZone3Code.push_back(str); }
list< string > fZone3Code
private every sub block
Definition: klass.hh:100

Here is the caller graph for this function:

void Klass::buildTasksList ( )

Definition at line 328 of file klass.cpp.

References addDeclCode(), addInitCode(), addZone2c(), addZone3(), computeUseCount(), Loop::fIndex, fTopLoop, gGroupTaskSwitch, groupSeqLoops(), gTaskCount, LAST_TASK_INDEX, sortGraph(), START_TASK_INDEX, START_TASK_MAX, subst(), and T().

Referenced by SchedulerCompiler::compileMultiSignal().

329 {
330  lgraph G;
331 
332  if (gGroupTaskSwitch) {
335  }
336 
337  sortGraph(fTopLoop, G);
338  int index_task = START_TASK_INDEX;
339 
340  addDeclCode("TaskGraph fGraph;");
341  addDeclCode("FAUSTFLOAT** input;");
342  addDeclCode("FAUSTFLOAT** output;");
343  addDeclCode("volatile bool fIsFinished;");
344  addDeclCode("int fFullCount;");
345  addDeclCode("int fIndex;");
346  addDeclCode("DSPThreadPool* fThreadPool;");
347  addDeclCode("int fStaticNumThreads;");
348  addDeclCode("int fDynamicNumThreads;");
349 
350  // Compute forward dependencies
351  for (int l=(int)G.size()-1; l>=0; l--) {
352  for (lset::const_iterator p =G[l].begin(); p!=G[l].end(); p++) {
353  for (lset::const_iterator p1 = (*p)->fBackwardLoopDependencies.begin(); p1!=(*p)->fBackwardLoopDependencies.end(); p1++) {
354  (*p1)->fForwardLoopDependencies.insert((*p));
355  }
356  (*p)->fIndex = index_task;
357  index_task++;
358  }
359  }
360 
361  // Compute ready tasks list
362  vector<int> task_num;
363  for (int l=(int)G.size()-1; l>=0; l--) {
364  lset::const_iterator next;
365  for (lset::const_iterator p =G[l].begin(); p!=G[l].end(); p++) {
366  if ((*p)->fBackwardLoopDependencies.size() == 0) {
367  task_num.push_back((*p)->fIndex);
368  }
369  }
370  }
371 
372  if (task_num.size() < START_TASK_MAX) {
373 
374  // Push ready tasks thread 0, execute one task directly
375 
376  addZone3("if (cur_thread == 0) {");
377 
378  Loop* keep = NULL;
379  for (int l=(int)G.size()-1; l>=0; l--) {
380  lset::const_iterator next;
381  for (lset::const_iterator p =G[l].begin(); p!=G[l].end(); p++) {
382  if ((*p)->fBackwardLoopDependencies.size() == 0) {
383  if (keep == NULL) {
384  keep = *p;
385  } else {
386  addZone3(subst(" taskqueue.PushHead($0);", T((*p)->fIndex)));
387  }
388  }
389  }
390  }
391 
392  if (keep != NULL) {
393  addZone3(subst(" tasknum = $0;", T(keep->fIndex)));
394  }
395 
396  addZone3("} else {");
397  addZone3(" tasknum = TaskQueue::GetNextTask(cur_thread, fDynamicNumThreads);");
398  addZone3("}");
399 
400  } else {
401 
402  // Cut ready tasks list and have each thread (dynamically) use a subpart
403  addZone3(subst("int task_list_size = $0;", T((int)task_num.size())));
404  stringstream buf;
405  buf << "int task_list[" << task_num.size() << "] = {";
406  for(size_t i = 0; i < task_num.size(); i++) {
407  buf << task_num[i];
408  if (i != (task_num.size() - 1))
409  buf << ",";
410  }
411  buf << "};";
412 
413  addZone3(buf.str());
414  addZone3("taskqueue.InitTaskList(task_list_size, task_list, fDynamicNumThreads, cur_thread, tasknum);");
415  }
416 
417  // Last stage connected to end task
418  if (G[0].size() > 1) {
419  addZone2c("// Initialize end task, if more than one input");
420  addZone2c(subst("fGraph.InitTask($0,$1);", T(LAST_TASK_INDEX), T((int)G[0].size())));
421  } else {
422  addZone2c("// End task has only one input, so will be directly activated");
423  }
424 
425  // Compute init section
426  addZone2c("// Only initialize taks with more than one input");
427  for (int l=(int)G.size()-1; l>=0; l--) {
428  for (lset::const_iterator p =G[l].begin(); p!=G[l].end(); p++) {
429  if ((*p)->fBackwardLoopDependencies.size() > 1) { // Only initialize taks with more than 1 input, since taks with one input are "directly" activated.
430  addZone2c(subst("fGraph.InitTask($0,$1);", T(START_TASK_INDEX + gTaskCount++), T((int)(*p)->fBackwardLoopDependencies.size())));
431  } else {
432  gTaskCount++;
433  }
434  }
435  }
436 
437  addInitCode("fStaticNumThreads = get_max_cpu();");
438  addInitCode("fDynamicNumThreads = getenv(\"OMP_NUM_THREADS\") ? atoi(getenv(\"OMP_NUM_THREADS\")) : fStaticNumThreads;");
439  addInitCode("fThreadPool = DSPThreadPool::Init();");
440  addInitCode("fThreadPool->StartAll(fStaticNumThreads - 1, false);");
441 
442  gTaskCount = 0;
443 }
void addZone2c(const string &str)
Definition: klass.hh:171
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
#define LAST_TASK_INDEX
Definition: klass.cpp:323
#define START_TASK_MAX
Definition: klass.cpp:326
vector< lset > lgraph
Definition: graphSorting.hh:12
void addInitCode(const string &str)
Definition: klass.hh:151
static int gTaskCount
Definition: klass.cpp:66
static void computeUseCount(Loop *l)
Compute how many time each loop is used in a DAG.
Definition: klass.cpp:288
#define START_TASK_INDEX
Definition: klass.cpp:324
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47
string T(char *c)
Definition: Text.cpp:158
void sortGraph(Loop *root, lgraph &V)
Topological sort of an acyclic graph of loops.
static void groupSeqLoops(Loop *l)
Group together sequences of loops.
Definition: klass.cpp:301
Definition: loop.hh:52
void addZone3(const string &str)
Definition: klass.hh:172
int fIndex
used during scheduler mode code generation
Definition: loop.hh:66
bool gGroupTaskSwitch
Definition: main.cpp:146
void addDeclCode(const string &str)
Definition: klass.hh:149

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::closeLoop ( Tree  sig)

Close the top loop and either keep it or absorb it within its enclosing loop.

Definition at line 117 of file klass.cpp.

References Loop::absorb(), Loop::fBackwardLoopDependencies, Loop::fEnclosingLoop, Loop::fRecSymbolSet, fTopLoop, Loop::hasRecDependencyIn(), hd(), Loop::isEmpty(), isNil(), setLoopProperty(), symlist(), and tl().

Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), VectorCompiler::generateCodeRecursions(), and VectorCompiler::generateLoopCode().

118 {
119  assert(fTopLoop);
120  Loop* l = fTopLoop;
122  assert(fTopLoop);
123 
124  //l->println(4, cerr);
125  //cerr << endl;
126 
127  Tree S = symlist(sig);
128  //cerr << "CLOSE LOOP :" << l << " with symbols " << *S << endl;
129  if (l->isEmpty() || fTopLoop->hasRecDependencyIn(S)) {
130  //cout << " will absorb" << endl;
131  // empty or dependent loop -> absorbed by enclosing one
132  //cerr << "absorbed by : " << fTopLoop << endl;
133  fTopLoop->absorb(l);
134  //delete l; HACK !!!
135  } else {
136  // cout << " will NOT absorb" << endl;
137  // we have an independent loop
138  setLoopProperty(sig,l); // associate the signal
140  // we need to indicate that all recursive symbols defined
141  // in this loop are defined in this loop
142  for (Tree lsym=l->fRecSymbolSet; !isNil(lsym); lsym=tl(lsym)) {
143  this->setLoopProperty(hd(lsym), l);
144  //cerr << "loop " << l << " defines " << *hd(lsym) << endl;
145  }
146  }
147  //cerr << "\n" << endl;
148 }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
void setLoopProperty(Tree sig, Loop *l)
Store the loop used to compute a signal.
Definition: klass.cpp:79
Loop *const fEnclosingLoop
Loop from which this one originated.
Definition: loop.hh:56
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
Tree hd(Tree l)
Definition: list.hh:133
bool isNil(Tree l)
Definition: list.hh:137
bool isEmpty()
true when the loop doesn't contain any line of code
Definition: loop.cpp:74
Tree fRecSymbolSet
recursive loops define a set of recursive symbol
Definition: loop.hh:55
void absorb(Loop *l)
absorb a loop inside this one
Definition: loop.cpp:113
bool hasRecDependencyIn(Tree S)
returns true is this loop or its ancestors define a symbol in S
Definition: loop.cpp:63
Tree symlist(Tree sig)
Definition: loop.hh:52
Tree tl(Tree l)
Definition: list.hh:134
set< Loop * > fBackwardLoopDependencies
Loops that must be computed before this one.
Definition: loop.hh:59

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::collectIncludeFile ( set< string > &  S)

Definition at line 1209 of file klass.cpp.

References fIncludeFileSet, fSubClassList, and merge().

Referenced by printIncludeFile().

1210 {
1211  list<Klass* >::iterator k;
1212 
1213  for (k = fSubClassList.begin(); k != fSubClassList.end(); k++) (*k)->collectIncludeFile(S);
1214  merge(S, fIncludeFileSet);
1215 }
static void merge(set< string > &dst, set< string > &src)
Definition: klass.cpp:1203
list< Klass * > fSubClassList
Definition: klass.hh:77
set< string > fIncludeFileSet
Definition: klass.hh:74

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::collectLibrary ( set< string > &  S)

Definition at line 1217 of file klass.cpp.

References fLibrarySet, fSubClassList, and merge().

Referenced by printLibrary().

1218 {
1219  list<Klass* >::iterator k;
1220 
1221  for (k = fSubClassList.begin(); k != fSubClassList.end(); k++) (*k)->collectLibrary(S);
1222  merge(S, fLibrarySet);
1223 }
static void merge(set< string > &dst, set< string > &src)
Definition: klass.cpp:1203
set< string > fLibrarySet
Definition: klass.hh:75
list< Klass * > fSubClassList
Definition: klass.hh:77

Here is the call graph for this function:

Here is the caller graph for this function:

const string& Klass::getClassName ( ) const
inline

Returns the name of the class.

Definition at line 131 of file klass.hh.

string Klass::getFullClassName ( )
inline

Returns the name of the class.

Definition at line 121 of file klass.hh.

bool Klass::getLoopProperty ( Tree  sig,
Loop *&  l 
)

Returns the loop used to compute a signal.

Definition at line 87 of file klass.cpp.

References fLoopProperty, and property< P >::get().

Referenced by VectorCompiler::CS().

88 {
89  return fLoopProperty.get(sig, l);
90 }
bool get(Tree t, P &data)
Definition: property.hh:32
property< Loop * > fLoopProperty
loops used to compute some signals
Definition: klass.hh:103

Here is the call graph for this function:

Here is the caller graph for this function:

Klass* Klass::getParentKlass ( )
inline

Definition at line 119 of file klass.hh.

119 { return fParentKlass; }
Klass * fParentKlass
Klass in which this Klass is embedded, void if toplevel Klass.
Definition: klass.hh:66
Klass* Klass::getTopParentKlass ( )
inline

Definition at line 120 of file klass.hh.

References getTopParentKlass().

Referenced by getTopParentKlass().

120 { return (fParentKlass != 0) ? fParentKlass->getTopParentKlass() : this; }
Klass * getTopParentKlass()
Definition: klass.hh:120
Klass * fParentKlass
Klass in which this Klass is embedded, void if toplevel Klass.
Definition: klass.hh:66

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::incUIActiveCount ( )
inline

Definition at line 161 of file klass.hh.

Referenced by Compiler::generateWidgetCode().

161 { fNumActives++; }
int fNumActives
number of active controls in the UI (sliders, buttons, etc.)
Definition: klass.hh:71

Here is the caller graph for this function:

void Klass::incUIPassiveCount ( )
inline

Definition at line 162 of file klass.hh.

Referenced by Compiler::generateWidgetCode().

162 { fNumPassives++; }
int fNumPassives
number of passive widgets in the UI (bargraphs, etc.)
Definition: klass.hh:72

Here is the caller graph for this function:

int Klass::inputs ( )
inline

Definition at line 209 of file klass.hh.

Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), and main().

209 { return fNumInputs; }
int fNumInputs
Definition: klass.hh:69

Here is the caller graph for this function:

void Klass::openLoop ( const string &  size)

Open a non-recursive loop on top of the stack of open loops.

Parameters
sizethe number of iterations of the loop

Definition at line 96 of file klass.cpp.

References fTopLoop.

Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), VectorCompiler::generateCodeRecursions(), and VectorCompiler::generateLoopCode().

97 {
98  fTopLoop = new Loop(fTopLoop, size);
99  //cerr << "\nOPEN SHARED LOOP(" << size << ") ----> " << fTopLoop << endl;
100 }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
Definition: loop.hh:52

Here is the caller graph for this function:

void Klass::openLoop ( Tree  recsymbol,
const string &  size 
)

Open a recursive loop on top of the stack of open loops.

Parameters
recsymbolthe recursive symbol defined in this loop
sizethe number of iterations of the loop

Definition at line 107 of file klass.cpp.

References fTopLoop.

108 {
109  fTopLoop = new Loop(recsymbol, fTopLoop, size);
110  //cerr << "\nOPEN REC LOOP(" << *recsymbol << ", " << size << ") ----> " << fTopLoop << endl;
111 }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
Definition: loop.hh:52
int Klass::outputs ( )
inline

Definition at line 210 of file klass.hh.

Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), and main().

210 { return fNumOutputs; }
int fNumOutputs
Definition: klass.hh:70

Here is the caller graph for this function:

void Klass::printAdditionalCode ( ostream &  fout)
virtual

Print additional functions required by the generated code.

Definition at line 217 of file klass.cpp.

References fNeedPowerDef, and gFloatSize.

Referenced by main().

218 {
219  if (fNeedPowerDef) {
220  // Add faustpower definition to C++ code
221  fout << "#ifndef FAUSTPOWER" << endl;
222  fout << "#define FAUSTPOWER" << endl;
223  fout << "#include <cmath>" << endl;
224  fout << "template <int N> inline float faustpower(float x) { return powf(x,N); } " << endl;
225  fout << "template <int N> inline double faustpower(double x) { return pow(x,N); }" << endl;
226  if (gFloatSize == 3) fout << "template <int N> inline long double faustpower(long double x) { return powl(x,N); }" << endl;
227  fout << "template <int N> inline int faustpower(int x) { return faustpower<N/2>(x) * faustpower<N-N/2>(x); } " << endl;
228  fout << "template <> inline int faustpower<0>(int x) { return 1; }" << endl;
229  fout << "template <> inline int faustpower<1>(int x) { return x; }" << endl;
230  fout << "#endif" << endl;
231  }
232 
233 }
int gFloatSize
Definition: main.cpp:153
static bool fNeedPowerDef
true when faustpower definition is needed
Definition: klass.hh:61

Here is the caller graph for this function:

void Klass::printComputeMethod ( int  n,
ostream &  fout 
)
virtual

Print Compute() method according to the various switch.

Definition at line 820 of file klass.cpp.

References gOpenMPSwitch, gSchedulerSwitch, gVectorLoopVariant, gVectorSwitch, printComputeMethodOpenMP(), printComputeMethodScalar(), printComputeMethodScheduler(), printComputeMethodVectorFaster(), and printComputeMethodVectorSimple().

Referenced by println().

821 {
822  if (gSchedulerSwitch) {
823  printComputeMethodScheduler (n, fout);
824  } else if (gOpenMPSwitch) {
825  printComputeMethodOpenMP (n, fout);
826  } else if (gVectorSwitch) {
827  switch (gVectorLoopVariant) {
828  case 0 : printComputeMethodVectorFaster(n, fout); break;
829  case 1 : printComputeMethodVectorSimple(n, fout); break;
830  default : cerr << "unknown loop variant " << gVectorLoopVariant << endl; exit(1);
831  }
832  } else {
833  printComputeMethodScalar(n, fout);
834  }
835 }
virtual void printComputeMethodVectorFaster(int n, ostream &fout)
Uses loops of constant gVecSize boundary in order to provide the C compiler with more optimisation op...
Definition: klass.cpp:853
virtual void printComputeMethodVectorSimple(int n, ostream &fout)
Simple loop layout, generally less efficient than printComputeMethodVectorFaster. ...
Definition: klass.cpp:882
int gVectorLoopVariant
Definition: main.cpp:141
bool gSchedulerSwitch
Definition: main.cpp:145
virtual void printComputeMethodScalar(int n, ostream &fout)
Definition: klass.cpp:837
virtual void printComputeMethodScheduler(int n, ostream &fout)
Definition: klass.cpp:1052
virtual void printComputeMethodOpenMP(int n, ostream &fout)
Definition: klass.cpp:953
bool gVectorSwitch
Definition: main.cpp:138
bool gOpenMPSwitch
Definition: main.cpp:143

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printComputeMethodOpenMP ( int  n,
ostream &  fout 
)
virtual

Definition at line 953 of file klass.cpp.

References fFirstPrivateDecl, fZone1Code, fZone2bCode, fZone2Code, fZone3Code, gVecSize, printdecllist(), printlines(), printLoopGraphOpenMP(), subst(), tab(), and xfloat().

Referenced by printComputeMethod().

954 {
955  // in openMP mode we need to split loops in smaller pieces not larger
956  // than gVecSize and add OpenMP pragmas
957  tab(n+1,fout); fout << subst("virtual void compute (int fullcount, $0** input, $0** output) {", xfloat());
958  printlines(n+2, fZone1Code, fout);
959  printlines(n+2, fZone2Code, fout);
960  tab(n+2,fout); fout << "#pragma omp parallel";
961  printdecllist(n+3, "firstprivate", fFirstPrivateDecl, fout);
962 
963  tab(n+2,fout); fout << "{";
964  if (!fZone2bCode.empty()) {
965  tab(n+3,fout); fout << "#pragma omp single";
966  tab(n+3,fout); fout << "{";
967  printlines(n+4, fZone2bCode, fout);
968  tab(n+3,fout); fout << "}";
969  }
970 
971  tab(n+3,fout); fout << "for (int index = 0; index < fullcount; index += " << gVecSize << ") {";
972  tab(n+4,fout); fout << "int count = min ("<< gVecSize << ", fullcount-index);";
973 
974  printlines (n+4, fZone3Code, fout);
975  printLoopGraphOpenMP (n+4,fout);
976 
977  tab(n+3,fout); fout << "}";
978 
979  tab(n+2,fout); fout << "}";
980  tab(n+1,fout); fout << "}";
981 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
list< string > fZone3Code
private every sub block
Definition: klass.hh:100
list< string > fZone2Code
first private
Definition: klass.hh:97
void printlines(int n, list< string > &lines, ostream &fout)
Print a list of lines.
Definition: klass.cpp:153
list< string > fZone2bCode
single once per block
Definition: klass.hh:98
const char * xfloat()
Definition: floats.cpp:49
list< string > fFirstPrivateDecl
first private declarations
Definition: klass.hh:94
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47
void printdecllist(int n, const string &decl, list< string > &content, ostream &fout)
Print a list of elements (e1, e2,...)
Definition: klass.cpp:164
virtual void printLoopGraphOpenMP(int n, ostream &fout)
Print the loop graph as a serie of parallel loops.
Definition: klass.cpp:479
int gVecSize
Definition: main.cpp:140
list< string > fZone1Code
shared vectors
Definition: klass.hh:96

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printComputeMethodScalar ( int  n,
ostream &  fout 
)
virtual

Definition at line 837 of file klass.cpp.

References fZone1Code, fZone2bCode, fZone2Code, fZone3Code, printlines(), printLoopGraphScalar(), subst(), tab(), and xfloat().

Referenced by printComputeMethod().

838 {
839  tab(n+1,fout); fout << subst("virtual void compute (int count, $0** input, $0** output) {", xfloat());
840  printlines (n+2, fZone1Code, fout);
841  printlines (n+2, fZone2Code, fout);
842  printlines (n+2, fZone2bCode, fout);
843  printlines (n+2, fZone3Code, fout);
844  printLoopGraphScalar (n+2,fout);
845  tab(n+1,fout); fout << "}";
846 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
list< string > fZone3Code
private every sub block
Definition: klass.hh:100
list< string > fZone2Code
first private
Definition: klass.hh:97
void printlines(int n, list< string > &lines, ostream &fout)
Print a list of lines.
Definition: klass.cpp:153
list< string > fZone2bCode
single once per block
Definition: klass.hh:98
const char * xfloat()
Definition: floats.cpp:49
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47
virtual void printLoopGraphScalar(int n, ostream &fout)
Print the loop graph (scalar mode)
Definition: klass.cpp:568
list< string > fZone1Code
shared vectors
Definition: klass.hh:96

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printComputeMethodScheduler ( int  n,
ostream &  fout 
)
virtual

Definition at line 1052 of file klass.cpp.

References fZone1Code, fZone2cCode, fZone2Code, fZone3Code, gTaskCount, gVecSize, printlines(), printLoopGraphScheduler(), START_TASK_INDEX, subst(), tab(), and xfloat().

Referenced by printComputeMethod().

1053 {
1054  tab(n+1,fout); fout << "void display() {";
1055  tab(n+2,fout); fout << "fGraph.Display();";
1056  tab(n+1,fout); fout << "}";
1057 
1058  tab(n+1,fout); fout << subst("virtual void compute (int fullcount, $0** input, $0** output) {", xfloat());
1059 
1060  tab(n+2,fout); fout << "GetRealTime();";
1061 
1062  tab(n+2,fout); fout << "this->input = input;";
1063  tab(n+2,fout); fout << "this->output = output;";
1064 
1065  tab(n+2,fout); fout << "StartMeasure();";
1066 
1067  tab(n+2,fout); fout << "for (fIndex = 0; fIndex < fullcount; fIndex += " << gVecSize << ") {";
1068 
1069  tab(n+3,fout); fout << "fFullCount = min ("<< gVecSize << ", fullcount-fIndex);";
1070  tab(n+3,fout); fout << "TaskQueue::Init();";
1071  printlines (n+3, fZone2cCode, fout);
1072 
1073  tab(n+3,fout); fout << "fIsFinished = false;";
1074  tab(n+3,fout); fout << "fThreadPool->SignalAll(fDynamicNumThreads - 1, this);";
1075  tab(n+3,fout); fout << "computeThread(0);";
1076  tab(n+3,fout); fout << "while (!fThreadPool->IsFinished()) {}";
1077 
1078  tab(n+2,fout); fout << "}";
1079 
1080  tab(n+2,fout); fout << "StopMeasure(fStaticNumThreads, fDynamicNumThreads);";
1081 
1082  tab(n+1,fout); fout << "}";
1083 
1084  tab(n+1,fout); fout << "void computeThread(int cur_thread) {";
1085  printlines (n+2, fZone1Code, fout);
1086  printlines (n+2, fZone2Code, fout);
1087 
1088  tab(n+2,fout); fout << "// Init graph state";
1089 
1090  tab(n+2,fout); fout << "{";
1091  tab(n+3,fout); fout << "TaskQueue taskqueue(cur_thread);";
1092  tab(n+3,fout); fout << "int tasknum = -1;";
1093  tab(n+3,fout); fout << "int count = fFullCount;";
1094 
1095  // Init input and output
1096  tab(n+3,fout); fout << "// Init input and output";
1097  printlines (n+3, fZone3Code, fout);
1098 
1099  tab(n+3,fout); fout << "while (!fIsFinished) {";
1100  tab(n+4,fout); fout << "switch (tasknum) {";
1101 
1102  // Work stealing task
1103  tab(n+5, fout); fout << "case WORK_STEALING_INDEX: { ";
1104  tab(n+6, fout); fout << "tasknum = TaskQueue::GetNextTask(cur_thread, fDynamicNumThreads);";
1105  tab(n+6, fout); fout << "break;";
1106  tab(n+5, fout); fout << "} ";
1107 
1108  // End task
1109  tab(n+5, fout); fout << "case LAST_TASK_INDEX: { ";
1110  tab(n+6, fout); fout << "fIsFinished = true;";
1111  tab(n+6, fout); fout << "break;";
1112  tab(n+5, fout); fout << "} ";
1113 
1115 
1116  // DSP tasks
1117  printLoopGraphScheduler (n+5,fout);
1118 
1119  tab(n+4,fout); fout << "}";
1120  tab(n+3,fout); fout << "}";
1121  tab(n+2,fout); fout << "}";
1122  tab(n+1,fout); fout << "}";
1123 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
list< string > fZone3Code
private every sub block
Definition: klass.hh:100
list< string > fZone2Code
first private
Definition: klass.hh:97
void printlines(int n, list< string > &lines, ostream &fout)
Print a list of lines.
Definition: klass.cpp:153
const char * xfloat()
Definition: floats.cpp:49
list< string > fZone2cCode
single once per block
Definition: klass.hh:99
static int gTaskCount
Definition: klass.cpp:66
#define START_TASK_INDEX
Definition: klass.cpp:324
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47
virtual void printLoopGraphScheduler(int n, ostream &fout)
Print the loop graph as a serie of parallel loops.
Definition: klass.cpp:499
int gVecSize
Definition: main.cpp:140
list< string > fZone1Code
shared vectors
Definition: klass.hh:96

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printComputeMethodVectorFaster ( int  n,
ostream &  fout 
)
virtual

Uses loops of constant gVecSize boundary in order to provide the C compiler with more optimisation opportunities.

Improves performances in general, but not always

Definition at line 853 of file klass.cpp.

References fZone1Code, fZone2bCode, fZone2Code, fZone3Code, gVecSize, printlines(), printLoopGraphVector(), subst(), tab(), and xfloat().

Referenced by printComputeMethod().

854 {
855  // in vector mode we need to split loops in smaller pieces not larger
856  // than gVecSize
857  tab(n+1,fout); fout << subst("virtual void compute (int fullcount, $0** input, $0** output) {", xfloat());
858  printlines(n+2, fZone1Code, fout);
859  printlines(n+2, fZone2Code, fout);
860  printlines(n+2, fZone2bCode, fout);
861 
862  tab(n+2,fout); fout << "int index;";
863  tab(n+2,fout); fout << "for (index = 0; index <= fullcount - " << gVecSize << "; index += " << gVecSize << ") {";
864  tab(n+3,fout); fout << "// compute by blocks of " << gVecSize << " samples";
865  tab(n+3,fout); fout << "const int count = " << gVecSize << ";";
866  printlines (n+3, fZone3Code, fout);
867  printLoopGraphVector(n+3,fout);
868  tab(n+2,fout); fout << "}";
869 
870  tab(n+2,fout); fout << "if (index < fullcount) {";
871  tab(n+3,fout); fout << "// compute the remaining samples if any";
872  tab(n+3,fout); fout << "int count = fullcount-index;";
873  printlines (n+3, fZone3Code, fout);
874  printLoopGraphVector(n+3,fout);
875  tab(n+2,fout); fout << "}";
876  tab(n+1,fout); fout << "}";
877 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
list< string > fZone3Code
private every sub block
Definition: klass.hh:100
list< string > fZone2Code
first private
Definition: klass.hh:97
void printlines(int n, list< string > &lines, ostream &fout)
Print a list of lines.
Definition: klass.cpp:153
list< string > fZone2bCode
single once per block
Definition: klass.hh:98
const char * xfloat()
Definition: floats.cpp:49
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47
virtual void printLoopGraphVector(int n, ostream &fout)
Print the loop graph (used for vector code)
Definition: klass.cpp:448
int gVecSize
Definition: main.cpp:140
list< string > fZone1Code
shared vectors
Definition: klass.hh:96

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printComputeMethodVectorSimple ( int  n,
ostream &  fout 
)
virtual

Simple loop layout, generally less efficient than printComputeMethodVectorFaster.

Definition at line 882 of file klass.cpp.

References fZone1Code, fZone2bCode, fZone2Code, fZone3Code, gVecSize, printlines(), printLoopGraphVector(), subst(), tab(), and xfloat().

Referenced by printComputeMethod().

883 {
884  // in vector mode we need to split loops in smaller pieces not larger
885  // than gVecSize
886  tab(n+1,fout); fout << subst("virtual void compute (int fullcount, $0** input, $0** output) {", xfloat());
887  printlines(n+2, fZone1Code, fout);
888  printlines(n+2, fZone2Code, fout);
889  printlines(n+2, fZone2bCode, fout);
890  tab(n+2,fout); fout << "for (int index = 0; index < fullcount; index += " << gVecSize << ") {";
891  tab(n+3,fout); fout << "int count = min("<< gVecSize << ", fullcount-index);";
892  printlines (n+3, fZone3Code, fout);
893  printLoopGraphVector(n+3,fout);
894  tab(n+2,fout); fout << "}";
895  tab(n+1,fout); fout << "}";
896 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
list< string > fZone3Code
private every sub block
Definition: klass.hh:100
list< string > fZone2Code
first private
Definition: klass.hh:97
void printlines(int n, list< string > &lines, ostream &fout)
Print a list of lines.
Definition: klass.cpp:153
list< string > fZone2bCode
single once per block
Definition: klass.hh:98
const char * xfloat()
Definition: floats.cpp:49
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47
virtual void printLoopGraphVector(int n, ostream &fout)
Print the loop graph (used for vector code)
Definition: klass.cpp:448
int gVecSize
Definition: main.cpp:140
list< string > fZone1Code
shared vectors
Definition: klass.hh:96

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printGraphDotFormat ( ostream &  fout)
virtual

Print the loop graph in dot format.

Definition at line 522 of file klass.cpp.

References fTopLoop, and sortGraph().

Referenced by main().

523 {
524  lgraph G;
525  sortGraph(fTopLoop, G);
526 
527  fout << "strict digraph loopgraph {" << endl;
528  fout << '\t' << "rankdir=LR;" << endl;
529  fout << '\t' << "node[color=blue, fillcolor=lightblue, style=filled, fontsize=9];" << endl;
530 
531  int lnum = 0; // used for loop numbers
532  // for each level of the graph
533  for (int l=(int)G.size()-1; l>=0; l--) {
534  // for each task in the level
535  for (lset::const_iterator t =G[l].begin(); t!=G[l].end(); t++) {
536  // print task label "Lxxx : 0xffffff"
537  fout << '\t' << 'L'<<(*t)<<"[label=<<font face=\"verdana,bold\">L"<<lnum++<<"</font> : "<<(*t)<<">];"<<endl;
538  // for each source of the task
539  for (lset::const_iterator src = (*t)->fBackwardLoopDependencies.begin(); src!=(*t)->fBackwardLoopDependencies.end(); src++) {
540  // print the connection Lxxx -> Lyyy;
541  fout << '\t' << 'L'<<(*src)<<"->"<<'L'<<(*t)<<';'<<endl;
542  }
543  }
544  }
545  fout << "}" << endl;
546 }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
vector< lset > lgraph
Definition: graphSorting.hh:12
void sortGraph(Loop *root, lgraph &V)
Topological sort of an acyclic graph of loops.

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printIncludeFile ( ostream &  fout)
virtual

Print the required include files.

Definition at line 199 of file klass.cpp.

References collectIncludeFile(), and gOpenMPSwitch.

Referenced by main().

200 {
201  set<string> S;
202  set<string>::iterator f;
203 
204  if (gOpenMPSwitch) {
205  fout << "#include <omp.h>" << "\n";
206  }
207 
209  for (f = S.begin(); f != S.end(); f++) {
210  fout << "#include " << *f << "\n";
211  }
212 }
void collectIncludeFile(set< string > &S)
Definition: klass.cpp:1209
bool gOpenMPSwitch
Definition: main.cpp:143

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLastLoopLevelScheduler ( int  n,
int  lnum,
const lset L,
ostream &  fout 
)
virtual

Print the 'level' of the loop graph as a set of parallel loops.

Definition at line 628 of file klass.cpp.

References gTaskCount, nonRecursiveLevel(), and tab().

Referenced by printLoopGraphScheduler().

629 {
630  if (nonRecursiveLevel(L) && L.size() == 1 && !(*L.begin())->isEmpty()) {
631 
632  lset::const_iterator p =L.begin();
633  tab(n, fout); fout << "case " << gTaskCount++ << ": { ";
634  (*p)->println(n+1, fout);
635  tab(n+1, fout); fout << "tasknum = LAST_TASK_INDEX;";
636  tab(n+1, fout); fout << "break;";
637  tab(n, fout); fout << "} ";
638 
639  } else if (L.size() > 1) {
640 
641  for (lset::const_iterator p =L.begin(); p!=L.end(); p++) {
642  tab(n, fout); fout << "case " << gTaskCount++ << ": { ";
643  (*p)->println(n+1, fout);
644  tab(n+1, fout); fout << "fGraph.ActivateOneOutputTask(taskqueue, LAST_TASK_INDEX, tasknum);";
645  tab(n+1, fout); fout << "break;";
646  tab(n, fout); fout << "} ";
647  }
648 
649  } else if (L.size() == 1 && !(*L.begin())->isEmpty()) {
650 
651  lset::const_iterator p =L.begin();
652  tab(n, fout); fout << "case " << gTaskCount++ << ": { ";
653  (*p)->println(n+1, fout);
654  tab(n+1, fout); fout << "tasknum = LAST_TASK_INDEX;";
655  tab(n+1, fout); fout << "break;";
656  tab(n, fout); fout << "} ";
657 
658  }
659 }
static bool nonRecursiveLevel(const lset &L)
returns true if all the loops are non recursive
Definition: klass.cpp:576
void tab(int n, ostream &fout)
Definition: klass.cpp:68
static int gTaskCount
Definition: klass.cpp:66

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLibrary ( ostream &  fout)
virtual

Print the required C++ libraries as comments in source code.

Definition at line 182 of file klass.cpp.

References collectLibrary().

Referenced by main().

183 {
184  set<string> S;
185  set<string>::iterator f;
186 
187  string sep;
188  collectLibrary(S);
189  fout << "/* link with ";
190  for (f = S.begin(), sep =": "; f != S.end(); f++, sep = ", ") {
191  fout << sep << *f;
192  }
193  fout << " */\n";
194 }
void collectLibrary(set< string > &S)
Definition: klass.cpp:1217

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::println ( int  n,
ostream &  fout 
)
virtual

Print a full C++ class corresponding to a Faust dsp.

Reimplemented in SigFloatGenKlass, and SigIntGenKlass.

Definition at line 737 of file klass.cpp.

References fDeclCode, fInitCode, fKlassName, fNumActives, fNumInputs, fNumOutputs, fNumPassives, fStaticFields, fStaticInitCode, fSubClassList, fSuperKlassName, fUICode, fUIMacro, gMetaDataSet, gSchedulerSwitch, gUIMacroSwitch, printComputeMethod(), printlines(), printMetadata(), and tab().

Referenced by main().

738 {
739  list<Klass* >::iterator k;
740 
741  tab(n,fout); fout << "#ifndef FAUSTCLASS " << endl;
742  fout << "#define FAUSTCLASS "<< fKlassName << endl;
743  fout << "#endif" << endl;
744 
745  if (gSchedulerSwitch) {
746  tab(n,fout); fout << "class " << fKlassName << " : public " << fSuperKlassName << ", public Runnable {";
747  } else {
748  tab(n,fout); fout << "class " << fKlassName << " : public " << fSuperKlassName << " {";
749  }
750 
751  if (gUIMacroSwitch) {
752  tab(n,fout); fout << " public:";
753  } else {
754  tab(n,fout); fout << " private:";
755  }
756 
757  for (k = fSubClassList.begin(); k != fSubClassList.end(); k++) (*k)->println(n+1, fout);
758 
759  printlines(n+1, fDeclCode, fout);
760 
761  tab(n,fout); fout << " public:";
762 
763  printMetadata(n+1, gMetaDataSet, fout);
764 
765  if (gSchedulerSwitch) {
766  tab(n+1,fout); fout << "virtual ~" << fKlassName << "() \t{ "
767  << "DSPThreadPool::Destroy()"
768  << "; }";
769  }
770 
771  tab(n+1,fout); fout << "virtual int getNumInputs() \t{ "
772  << "return " << fNumInputs
773  << "; }";
774  tab(n+1,fout); fout << "virtual int getNumOutputs() \t{ "
775  << "return " << fNumOutputs
776  << "; }";
777 
778  tab(n+1,fout); fout << "static void classInit(int samplingFreq) {";
779  printlines (n+2, fStaticInitCode, fout);
780  tab(n+1,fout); fout << "}";
781 
782  tab(n+1,fout); fout << "virtual void instanceInit(int samplingFreq) {";
783  tab(n+2,fout); fout << "fSamplingFreq = samplingFreq;";
784  printlines (n+2, fInitCode, fout);
785  tab(n+1,fout); fout << "}";
786 
787  tab(n+1,fout); fout << "virtual void init(int samplingFreq) {";
788  tab(n+2,fout); fout << "classInit(samplingFreq);";
789  tab(n+2,fout); fout << "instanceInit(samplingFreq);";
790  tab(n+1,fout); fout << "}";
791 
792 
793  tab(n+1,fout); fout << "virtual void buildUserInterface(UI* interface) {";
794  printlines (n+2, fUICode, fout);
795  tab(n+1,fout); fout << "}";
796 
797  printComputeMethod(n, fout);
798 
799  tab(n,fout); fout << "};\n" << endl;
800 
801  printlines(n, fStaticFields, fout);
802 
803  // generate user interface macros if needed
804  if (gUIMacroSwitch) {
805  tab(n, fout); fout << "#ifdef FAUST_UIMACROS";
806  tab(n+1,fout); fout << "#define FAUST_INPUTS " << fNumInputs;
807  tab(n+1,fout); fout << "#define FAUST_OUTPUTS " << fNumOutputs;
808  tab(n+1,fout); fout << "#define FAUST_ACTIVES " << fNumActives;
809  tab(n+1,fout); fout << "#define FAUST_PASSIVES " << fNumPassives;
810  printlines(n+1, fUIMacro, fout);
811  tab(n, fout); fout << "#endif";
812  }
813 
814  fout << endl;
815 }
list< string > fDeclCode
Definition: klass.hh:79
void tab(int n, ostream &fout)
Definition: klass.cpp:68
list< string > fInitCode
Definition: klass.hh:82
int fNumInputs
Definition: klass.hh:69
void printlines(int n, list< string > &lines, ostream &fout)
Print a list of lines.
Definition: klass.cpp:153
virtual void printComputeMethod(int n, ostream &fout)
Print Compute() method according to the various switch.
Definition: klass.cpp:820
bool gSchedulerSwitch
Definition: main.cpp:145
list< string > fStaticFields
static fields after class
Definition: klass.hh:81
list< string > fUIMacro
Definition: klass.hh:84
int fNumActives
number of active controls in the UI (sliders, buttons, etc.)
Definition: klass.hh:71
int fNumPassives
number of passive widgets in the UI (bargraphs, etc.)
Definition: klass.hh:72
int fNumOutputs
Definition: klass.hh:70
map< Tree, set< Tree > > gMetaDataSet
Definition: main.cpp:91
bool gUIMacroSwitch
Definition: main.cpp:148
string fKlassName
Definition: klass.hh:67
list< string > fStaticInitCode
static init code for class constant tables
Definition: klass.hh:80
string fSuperKlassName
Definition: klass.hh:68
list< Klass * > fSubClassList
Definition: klass.hh:77
list< string > fUICode
Definition: klass.hh:83
virtual void printMetadata(int n, const map< Tree, set< Tree > > &S, ostream &fout)
Print metadata declaration.
Definition: klass.cpp:238

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLoopDeepFirst ( int  n,
ostream &  fout,
Loop l,
set< Loop * > &  visited 
)
virtual

Print a loop graph deep first.

Definition at line 267 of file klass.cpp.

References Loop::fBackwardLoopDependencies, Loop::fOrder, isElement(), Loop::println(), and tab().

Referenced by printLoopGraphVector().

268 {
269  // avoid printing already printed loops
270  if (isElement(visited, l)) return;
271 
272  // remember we have printed this loop
273  visited.insert(l);
274 
275  // print the dependencies loops (that need to be computed before this one)
276  for (lset::const_iterator p =l->fBackwardLoopDependencies.begin(); p!=l->fBackwardLoopDependencies.end(); p++) {
277  printLoopDeepFirst(n, fout, *p, visited);
278  }
279  // the print the loop itself
280  tab(n, fout);
281  tab(n, fout); fout << "// LOOP " << l << ", ORDER " << l->fOrder << endl;
282  l->println(n+1, fout);
283 }
void println(int n, ostream &fout)
print the loop
Definition: loop.cpp:134
void tab(int n, ostream &fout)
Definition: klass.cpp:68
virtual void printLoopDeepFirst(int n, ostream &fout, Loop *l, set< Loop * > &visited)
Print a loop graph deep first.
Definition: klass.cpp:267
bool isElement(const set< Loop * > &S, Loop *l)
Definition: klass.cpp:259
int fOrder
used during topological sort
Definition: loop.hh:65
set< Loop * > fBackwardLoopDependencies
Loops that must be computed before this one.
Definition: loop.hh:59

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLoopGraphInternal ( int  n,
ostream &  fout 
)
virtual

Print the loop graph (used for internals classes)

Definition at line 551 of file klass.cpp.

References fTopLoop, gVectorSwitch, sortGraph(), and tab().

Referenced by SigIntGenKlass::println(), and SigFloatGenKlass::println().

552 {
553  lgraph G;
554  sortGraph(fTopLoop, G);
555 
556  // normal mode
557  for (int l=(int)G.size()-1; l>=0; l--) {
558  if (gVectorSwitch) { tab(n, fout); fout << "// SECTION : " << G.size() - l; }
559  for (lset::const_iterator p =G[l].begin(); p!=G[l].end(); p++) {
560  (*p)->printoneln(n, fout);
561  }
562  }
563 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
vector< lset > lgraph
Definition: graphSorting.hh:12
void sortGraph(Loop *root, lgraph &V)
Topological sort of an acyclic graph of loops.
bool gVectorSwitch
Definition: main.cpp:138

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLoopGraphOpenMP ( int  n,
ostream &  fout 
)
virtual

Print the loop graph as a serie of parallel loops.

Definition at line 479 of file klass.cpp.

References computeUseCount(), fTopLoop, gGroupTaskSwitch, groupSeqLoops(), printLoopLevelOpenMP(), sortGraph(), and tab().

Referenced by printComputeMethodOpenMP().

480 {
481  if (gGroupTaskSwitch) {
484  }
485 
486  lgraph G;
487  sortGraph(fTopLoop, G);
488 
489  // OpenMP mode : add OpenMP directives
490  for (int l=(int)G.size()-1; l>=0; l--) {
491  tab(n, fout); fout << "// SECTION : " << G.size() - l;
492  printLoopLevelOpenMP(n, (int)G.size() - l, G[l], fout);
493  }
494 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
vector< lset > lgraph
Definition: graphSorting.hh:12
static void computeUseCount(Loop *l)
Compute how many time each loop is used in a DAG.
Definition: klass.cpp:288
virtual void printLoopLevelOpenMP(int n, int lnum, const lset &L, ostream &fout)
Print the 'level' of the loop graph as a set of parallel loops.
Definition: klass.cpp:588
void sortGraph(Loop *root, lgraph &V)
Topological sort of an acyclic graph of loops.
static void groupSeqLoops(Loop *l)
Group together sequences of loops.
Definition: klass.cpp:301
bool gGroupTaskSwitch
Definition: main.cpp:146

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLoopGraphScalar ( int  n,
ostream &  fout 
)
virtual

Print the loop graph (scalar mode)

Definition at line 568 of file klass.cpp.

References fTopLoop, and Loop::printoneln().

Referenced by printComputeMethodScalar().

569 {
570  fTopLoop->printoneln(n, fout);
571 }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
void printoneln(int n, ostream &fout)
print the loop in scalar mode
Definition: loop.cpp:214

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLoopGraphScheduler ( int  n,
ostream &  fout 
)
virtual

Print the loop graph as a serie of parallel loops.

Definition at line 499 of file klass.cpp.

References computeUseCount(), fTopLoop, gGroupTaskSwitch, groupSeqLoops(), printLastLoopLevelScheduler(), printLoopLevelScheduler(), sortGraph(), and tab().

Referenced by printComputeMethodScheduler().

500 {
501  if (gGroupTaskSwitch) {
504  }
505 
506  lgraph G;
507  sortGraph(fTopLoop, G);
508 
509  // OpenMP mode : add OpenMP directives
510  for (int l=(int)G.size()-1; l>0; l--) {
511  tab(n, fout); fout << "// SECTION : " << G.size() - l;
512  printLoopLevelScheduler(n, (int)G.size() - l, G[l], fout);
513  }
514 
515  printLastLoopLevelScheduler(n, (int)G.size(), G[0], fout);
516 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
vector< lset > lgraph
Definition: graphSorting.hh:12
static void computeUseCount(Loop *l)
Compute how many time each loop is used in a DAG.
Definition: klass.cpp:288
void sortGraph(Loop *root, lgraph &V)
Topological sort of an acyclic graph of loops.
static void groupSeqLoops(Loop *l)
Group together sequences of loops.
Definition: klass.cpp:301
virtual void printLastLoopLevelScheduler(int n, int lnum, const lset &L, ostream &fout)
Print the 'level' of the loop graph as a set of parallel loops.
Definition: klass.cpp:628
virtual void printLoopLevelScheduler(int n, int lnum, const lset &L, ostream &fout)
Print the 'level' of the loop graph as a set of parallel loops.
Definition: klass.cpp:721
bool gGroupTaskSwitch
Definition: main.cpp:146

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLoopGraphVector ( int  n,
ostream &  fout 
)
virtual

Print the loop graph (used for vector code)

Definition at line 448 of file klass.cpp.

References computeUseCount(), fTopLoop, gDeepFirstSwitch, gGroupTaskSwitch, groupSeqLoops(), gVectorSwitch, printLoopDeepFirst(), sortGraph(), and tab().

Referenced by printComputeMethodVectorFaster(), and printComputeMethodVectorSimple().

449 {
450  if (gGroupTaskSwitch) {
453  }
454 
455  lgraph G;
456  sortGraph(fTopLoop, G);
457 
458 #if 1
459  // EXPERIMENTAL
461  set<Loop*> visited;
462  printLoopDeepFirst(n, fout, fTopLoop, visited);
463  return;
464  }
465 #endif
466 
467  // normal mode
468  for (int l=(int)G.size()-1; l>=0; l--) {
469  if (gVectorSwitch) { tab(n, fout); fout << "// SECTION : " << G.size() - l; }
470  for (lset::const_iterator p =G[l].begin(); p!=G[l].end(); p++) {
471  (*p)->println(n, fout);
472  }
473  }
474 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102
vector< lset > lgraph
Definition: graphSorting.hh:12
static void computeUseCount(Loop *l)
Compute how many time each loop is used in a DAG.
Definition: klass.cpp:288
virtual void printLoopDeepFirst(int n, ostream &fout, Loop *l, set< Loop * > &visited)
Print a loop graph deep first.
Definition: klass.cpp:267
bool gDeepFirstSwitch
Definition: main.cpp:139
void sortGraph(Loop *root, lgraph &V)
Topological sort of an acyclic graph of loops.
static void groupSeqLoops(Loop *l)
Group together sequences of loops.
Definition: klass.cpp:301
bool gVectorSwitch
Definition: main.cpp:138
bool gGroupTaskSwitch
Definition: main.cpp:146

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLoopLevelOpenMP ( int  n,
int  lnum,
const lset L,
ostream &  fout 
)
virtual

Print the 'level' of the loop graph as a set of parallel loops.

Definition at line 588 of file klass.cpp.

References gOpenMPLoop, nonRecursiveLevel(), and tab().

Referenced by printLoopGraphOpenMP().

589 {
590  if (nonRecursiveLevel(L) && L.size()==1) {
591  for (lset::const_iterator p =L.begin(); p!=L.end(); p++) {
592  if ((*p)->isEmpty() == false) {
593  if (gOpenMPLoop) {
594  (*p)->printParLoopln(n, fout);
595  } else {
596  tab(n, fout); fout << "#pragma omp single ";
597  tab(n, fout); fout << "{ ";
598  (*p)->println(n+1, fout);
599  tab(n, fout); fout << "} ";
600  }
601  }
602  }
603 
604  } else if (L.size() > 1) {
605  tab(n, fout); fout << "#pragma omp sections ";
606  tab(n, fout); fout << "{ ";
607  for (lset::const_iterator p =L.begin(); p!=L.end(); p++) {
608  tab(n+1, fout); fout << "#pragma omp section ";
609  tab(n+1, fout); fout << "{";
610  (*p)->println(n+2, fout);
611  tab(n+1, fout); fout << "} ";
612  }
613  tab(n, fout); fout << "} ";
614  } else if (L.size() == 1 && !(*L.begin())->isEmpty()) {
615  tab(n, fout); fout << "#pragma omp single ";
616  tab(n, fout); fout << "{ ";
617  for (lset::const_iterator p =L.begin(); p!=L.end(); p++) {
618  (*p)->println(n+1, fout);
619  }
620  tab(n, fout); fout << "} ";
621  }
622 }
static bool nonRecursiveLevel(const lset &L)
returns true if all the loops are non recursive
Definition: klass.cpp:576
void tab(int n, ostream &fout)
Definition: klass.cpp:68
bool gOpenMPLoop
Definition: main.cpp:144

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printLoopLevelScheduler ( int  n,
int  lnum,
const lset L,
ostream &  fout 
)
virtual

Print the 'level' of the loop graph as a set of parallel loops.

Definition at line 721 of file klass.cpp.

References nonRecursiveLevel(), and printOneLoopScheduler().

Referenced by printLoopGraphScheduler().

722 {
723  if (nonRecursiveLevel(L) && L.size() == 1 && !(*L.begin())->isEmpty()) {
724  printOneLoopScheduler(L.begin(), n, fout);
725  } else if (L.size() > 1) {
726  for (lset::const_iterator p = L.begin(); p != L.end(); p++) {
727  printOneLoopScheduler(p, n, fout);
728  }
729  } else if (L.size() == 1 && !(*L.begin())->isEmpty()) {
730  printOneLoopScheduler(L.begin(), n, fout);
731  }
732 }
static bool nonRecursiveLevel(const lset &L)
returns true if all the loops are non recursive
Definition: klass.cpp:576
virtual void printOneLoopScheduler(lset::const_iterator p, int n, ostream &fout)
Definition: klass.cpp:661

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printMetadata ( int  n,
const map< Tree, set< Tree > > &  S,
ostream &  fout 
)
virtual

Print metadata declaration.

Definition at line 238 of file klass.cpp.

References gMetaDataSet, tab(), and tree().

Referenced by println().

239 {
240  tab(n,fout); fout << "static void metadata(Meta* m) \t{ ";
241 
242  for (map<Tree, set<Tree> >::iterator i = gMetaDataSet.begin(); i != gMetaDataSet.end(); i++) {
243  if (i->first != tree("author")) {
244  tab(n+1,fout); fout << "m->declare(\"" << *(i->first) << "\", " << **(i->second.begin()) << ");";
245  } else {
246  for (set<Tree>::iterator j = i->second.begin(); j != i->second.end(); j++) {
247  if (j == i->second.begin()) {
248  tab(n+1,fout); fout << "m->declare(\"" << *(i->first) << "\", " << **j << ");" ;
249  } else {
250  tab(n+1,fout); fout << "m->declare(\"" << "contributor" << "\", " << **j << ");";
251  }
252  }
253  }
254  }
255 
256  tab(n,fout); fout << "}" << endl;
257 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
map< Tree, set< Tree > > gMetaDataSet
Definition: main.cpp:91
Tree tree(const Node &n)
Definition: tree.hh:186

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::printOneLoopScheduler ( lset::const_iterator  p,
int  n,
ostream &  fout 
)
virtual

Definition at line 661 of file klass.cpp.

References Loop::fIndex, gTaskCount, subst(), T(), and tab().

Referenced by printLoopLevelScheduler().

662 {
663  tab(n, fout); fout << "case " << gTaskCount++ << ": { ";
664  (*p)->println(n+1, fout);
665 
666  // One output only
667  if ((*p)->fForwardLoopDependencies.size() == 1) {
668 
669  lset::const_iterator p1 = (*p)->fForwardLoopDependencies.begin();
670  if ((*p1)->fBackwardLoopDependencies.size () == 1) {
671  tab(n+1, fout); fout << subst("tasknum = $0;", T((*p1)->fIndex));
672  } else {
673  tab(n+1, fout); fout << subst("fGraph.ActivateOneOutputTask(taskqueue, $0, tasknum);", T((*p1)->fIndex));
674  }
675 
676  } else {
677 
678  Loop* keep = NULL;
679  // Find one output with only one backward dependencies
680  for (lset::const_iterator p1 = (*p)->fForwardLoopDependencies.begin(); p1!=(*p)->fForwardLoopDependencies.end(); p1++) {
681  if ((*p1)->fBackwardLoopDependencies.size () == 1) {
682  keep = *p1;
683  break;
684  }
685  }
686 
687  if (keep == NULL) {
688  tab(n+1, fout); fout << "tasknum = WORK_STEALING_INDEX;";
689  }
690 
691  for (lset::const_iterator p1 = (*p)->fForwardLoopDependencies.begin(); p1!=(*p)->fForwardLoopDependencies.end(); p1++) {
692  if ((*p1)->fBackwardLoopDependencies.size () == 1) { // Task is the only input
693  if (*p1 != keep) {
694  tab(n+1, fout); fout << subst("taskqueue.PushHead($0);", T((*p1)->fIndex));
695  }
696  } else {
697  if (keep == NULL) {
698  tab(n+1, fout); fout << subst("fGraph.ActivateOutputTask(taskqueue, $0, tasknum);", T((*p1)->fIndex));
699  } else {
700  tab(n+1, fout); fout << subst("fGraph.ActivateOutputTask(taskqueue, $0);", T((*p1)->fIndex));
701  }
702  }
703  }
704 
705  if (keep != NULL) {
706  tab(n+1, fout); fout << subst("tasknum = $0;", T(keep->fIndex)); // Last one
707  } else {
708  tab(n+1, fout); fout << "fGraph.GetReadyTask(taskqueue, tasknum);"; // Last one
709  }
710  }
711 
712  tab(n+1, fout); fout << "break;";
713  tab(n, fout); fout << "} ";
714 }
void tab(int n, ostream &fout)
Definition: klass.cpp:68
static int gTaskCount
Definition: klass.cpp:66
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47
string T(char *c)
Definition: Text.cpp:158
Definition: loop.hh:52
int fIndex
used during scheduler mode code generation
Definition: loop.hh:66

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::rememberNeedPowerDef ( )
inline

Definition at line 141 of file klass.hh.

Referenced by PowPrim::generateCode().

141 { fNeedPowerDef = true; }
static bool fNeedPowerDef
true when faustpower definition is needed
Definition: klass.hh:61

Here is the caller graph for this function:

void Klass::setLoopProperty ( Tree  sig,
Loop l 
)

Store the loop used to compute a signal.

Definition at line 79 of file klass.cpp.

References fLoopProperty, and property< P >::set().

Referenced by closeLoop().

80 {
81  fLoopProperty.set(sig,l);
82 }
void set(Tree t, const P &data)
Definition: property.hh:22
property< Loop * > fLoopProperty
loops used to compute some signals
Definition: klass.hh:103

Here is the call graph for this function:

Here is the caller graph for this function:

void Klass::setParentKlass ( Klass parent)
inline

Definition at line 117 of file klass.hh.

117  { std::cerr << this << " setParentKlass(" << parent << ")" << std::endl;
118  fParentKlass=parent; }
Klass * fParentKlass
Klass in which this Klass is embedded, void if toplevel Klass.
Definition: klass.hh:66
Loop* Klass::topLoop ( )
inline

Definition at line 133 of file klass.hh.

Referenced by VectorCompiler::CS(), and VectorCompiler::generateLoopCode().

133 { return fTopLoop; }
Loop * fTopLoop
active loops currently open
Definition: klass.hh:102

Here is the caller graph for this function:

Member Data Documentation

list<string> Klass::fDeclCode
protected

Definition at line 79 of file klass.hh.

Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().

list<string> Klass::fFirstPrivateDecl
protected

first private declarations

Definition at line 94 of file klass.hh.

Referenced by printComputeMethodOpenMP().

set<string> Klass::fIncludeFileSet
protected

Definition at line 74 of file klass.hh.

Referenced by collectIncludeFile().

list<string> Klass::fInitCode
protected

Definition at line 82 of file klass.hh.

Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().

string Klass::fKlassName
protected

Definition at line 67 of file klass.hh.

Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().

set<string> Klass::fLibrarySet
protected

Definition at line 75 of file klass.hh.

Referenced by collectLibrary().

property<Loop*> Klass::fLoopProperty
protected

loops used to compute some signals

Definition at line 103 of file klass.hh.

Referenced by getLoopProperty(), and setLoopProperty().

bool Klass::fNeedPowerDef = false
staticprotected

true when faustpower definition is needed

Definition at line 61 of file klass.hh.

Referenced by printAdditionalCode().

int Klass::fNumActives
protected

number of active controls in the UI (sliders, buttons, etc.)

Definition at line 71 of file klass.hh.

Referenced by println().

int Klass::fNumInputs
protected

Definition at line 69 of file klass.hh.

Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().

int Klass::fNumOutputs
protected

Definition at line 70 of file klass.hh.

Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().

int Klass::fNumPassives
protected

number of passive widgets in the UI (bargraphs, etc.)

Definition at line 72 of file klass.hh.

Referenced by println().

Klass* Klass::fParentKlass
protected

Klass in which this Klass is embedded, void if toplevel Klass.

Definition at line 66 of file klass.hh.

list<string> Klass::fSharedDecl
protected

shared declarations

Definition at line 93 of file klass.hh.

list<string> Klass::fStaticFields
protected

static fields after class

Definition at line 81 of file klass.hh.

Referenced by println().

list<string> Klass::fStaticInitCode
protected

static init code for class constant tables

Definition at line 80 of file klass.hh.

Referenced by println().

list<Klass* > Klass::fSubClassList
protected
string Klass::fSuperKlassName
protected

Definition at line 68 of file klass.hh.

Referenced by println().

Loop* Klass::fTopLoop
protected
list<string> Klass::fUICode
protected

Definition at line 83 of file klass.hh.

Referenced by println().

list<string> Klass::fUIMacro
protected

Definition at line 84 of file klass.hh.

Referenced by println().

bool Klass::fVec
protected

Definition at line 105 of file klass.hh.

list<string> Klass::fZone1Code
protected
list<string> Klass::fZone2bCode
protected
list<string> Klass::fZone2cCode
protected

single once per block

Definition at line 99 of file klass.hh.

Referenced by printComputeMethodScheduler().

list<string> Klass::fZone2Code
protected
list<string> Klass::fZone3Code
protected

The documentation for this class was generated from the following files: