FAUST compiler  0.9.9.6b8
Typedefs | Functions
graphSorting.hh File Reference
#include <set>
#include "loop.hh"
Include dependency graph for graphSorting.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef set< Loop * > lset
typedef vector< Loop * > lvec
typedef vector< lsetlgraph

Functions

void sortGraph (Loop *root, lgraph &V)
 Topological sort of an acyclic graph of loops starting from its root.

Typedef Documentation

typedef vector<lset> lgraph

Definition at line 12 of file graphSorting.hh.

typedef set<Loop*> lset

Definition at line 10 of file graphSorting.hh.

typedef vector<Loop*> lvec

Definition at line 11 of file graphSorting.hh.


Function Documentation

void sortGraph ( Loop root,
lgraph V 
)

Topological sort of an acyclic graph of loops starting from its root.

The loops are collect in an lgraph : a vector of sets of loops

Topological sort of an acyclic graph of loops starting from its root.

The loops are collect in an lgraph : a vector of sets of loops

Definition at line 38 of file graphSorting.cpp.

References resetOrder(), and setLevel().

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

{
    lset            T1, T2;
    int             level;
    
    assert(root);
    resetOrder(root);
    T1.insert(root); level=0; V.clear();
    do {
        setLevel(level, T1, T2, V); 
        T1=T2; T2.clear(); level++;
    } while (T1.size()>0);
    
    // Erase empty levels
    lgraph::iterator p = V.begin();
    while (p != V.end()) {
        if ((*p).size() == 1 && (*(*p).begin())->isEmpty()) {
            p = V.erase(p);
        } else {
            p++; 
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function: