#include <set>
#include "loop.hh"
Go to the source code of this file.
Typedefs | |
typedef set< Loop * > | lset |
typedef vector< Loop * > | lvec |
typedef vector< lset > | lgraph |
Functions | |
void | sortGraph (Loop *root, lgraph &V) |
Topological sort of an acyclic graph of loops starting from its root. |
Definition at line 12 of file graphSorting.hh.
Definition at line 10 of file graphSorting.hh.
Definition at line 11 of file graphSorting.hh.
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::printLoopGraphInternal(), Klass::printLoopGraphOpenMP(), Klass::printLoopGraphScheduler(), and Klass::printLoopGraphVector().
00039 { 00040 lset T1, T2; 00041 int level; 00042 00043 assert(root); 00044 resetOrder(root); 00045 T1.insert(root); level=0; V.clear(); 00046 do { 00047 setLevel(level, T1, T2, V); 00048 T1=T2; T2.clear(); level++; 00049 } while (T1.size()>0); 00050 00051 // Erase empty levels 00052 lgraph::iterator p = V.begin(); 00053 while (p != V.end()) { 00054 if ((*p).size() == 1 && (*(*p).begin())->isEmpty()) { 00055 p = V.erase(p); 00056 } else { 00057 p++; 00058 } 00059 } 00060 }