CGraph
Static Protected Member Functions | Friends | List of all members
GMaxParaOptimizer Class Reference

#include <GMaxParaOptimizer.h>

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

Static Protected Member Functions

static CBool match (const GSortedGElementPtrSet &elements)
 
static CSize getMaxParaSize (const GSortedGElementPtrSet &elements)
 
static CSize calcMaxCliqueSize (const std::vector< std::vector< int >> &graph)
 
- Static Protected Member Functions inherited from GOptimizer
static CVoid collect (GElementPtr element, std::vector< GElementPtr > &curPath, std::vector< std::vector< GElementPtr >> &paths)
 
static std::vector< std::vector< GElementPtr > > collectPaths (const GSortedGElementPtrSet &elements)
 
static std::vector< std::vector< int > > buildGraph (const GSortedGElementPtrSet &elements, const std::vector< std::vector< GElementPtr >> &paths, int father, int son, int unlink)
 

Friends

class GElementManager
 

Additional Inherited Members

- Public Member Functions inherited from CObject
 CObject ()=default
 
virtual CStatus init ()
 
virtual CStatus run ()=0
 
virtual CStatus destroy ()
 
virtual ~CObject ()=default
 

Member Function Documentation

◆ calcMaxCliqueSize()

static CSize GMaxParaOptimizer::calcMaxCliqueSize ( const std::vector< std::vector< int >> &  graph)
inlinestaticprotected

计算当前最大团的大小

Parameters
graph
Returns

◆ getMaxParaSize()

static CSize GMaxParaOptimizer::getMaxParaSize ( const GSortedGElementPtrSet elements)
inlinestaticprotected

计算当前dag的最大并发度

Parameters
elements
Returns

计算思路如下:

  1. 列出来所有的可行路径(paths)
  2. 根据路径,生成一张全连通图,然后将图取反,得到对应的补图(reGraph)
  3. 计算补图的最大团中元素个数(maxCliqueSize),即为当前dag的最大并行度
Here is the call graph for this function:

◆ match()

static CBool GMaxParaOptimizer::match ( const GSortedGElementPtrSet elements)
inlinestaticprotected

判定是否match计算条件

Parameters
elements
Returns

Friends And Related Function Documentation

◆ GElementManager

friend class GElementManager
friend

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