|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--coins.hir2lir.ReformHir
ReformHir class Reform HIR for profiling and parallelization without using OpenMP.
コンストラクタの概要 | |
ReformHir(HirRoot pHirRoot)
ReformHir Process HIR pragmas and change them to ones that may correspond to HIR pragma. |
メソッドの概要 | |
protected void |
callHirBaseToC(HirRoot hirRoot,
SymRoot symRoot,
IoRoot io,
java.io.OutputStream out)
Translates HIR-Base into a C source program and writes it to an OutputStream. |
protected void |
changeLoopToSubprogram(LoopTable pTable)
Change loop indicated by pTable to a subprogram to be executed in parallel. |
Param |
defineParam(java.lang.String pHeader,
Type pType,
SymTable pSymTable)
|
Var |
defineVar(java.lang.String pHeader,
Type pType,
SymTable pSymTable,
Subp pDefinedIn)
|
protected Var |
getPrimaryInductionVar(ForStmt pForStmt)
Get the primary induction variable of the loop. |
protected Reduction |
getReductionForVar(Var pVar,
java.util.List pReductionList)
|
protected java.util.List |
getReductionList(LoopTable pTable)
Get the list of reductions for the loop represented by pTable. |
protected java.util.Set |
getReductionVar(java.util.List pReductionList)
Get all reduction variables each of which corresponds to the reduction table in pReductionList. |
protected Var |
getVarOfExp(Exp pExp)
Get the variable represented by pExp or by its child 1 node. |
protected Exp |
initialValueOfReduction(LoopTable pTable,
Var pReductionVar)
|
protected boolean |
makeCSourceFromHirBase(java.lang.String timing,
HirRoot hirRoot,
SymRoot symRoot,
IoRoot io)
|
protected SubpDefinition |
makeSubpDefinition(LoopTable pTable,
java.util.List pInLoopVarList,
java.util.List pChangeToLocal,
java.util.List pChangeToGlobal,
java.util.Set pInductionVars,
java.util.Set pReductionVarSet,
java.util.Set pReductionsToInitiate,
java.util.List pPassPointer,
java.util.Set pCopyToChild,
java.util.Set pCopyBack)
Make subprogram definition corresponding to the loop represented by pTable. |
protected boolean |
parallelize(SubpDefinition pSubpDefinition)
Parallelize the subprogram pSubpDefinition. |
void |
printList(java.util.List pList,
java.lang.String pHeader)
Print the list pList with header pHeader. |
protected void |
printLoopTable(LoopTable pTable)
|
void |
printSet(java.util.Set pSet,
java.lang.String pHeader)
Print the set pSet with header indicated by pHeader. |
protected boolean |
reformForInitiation(SubpDefinition pSubpDefinition)
Reform for thread initiation without parallelizing. |
void |
reformForParallel()
|
void |
reformForProfiling()
Change global gragmas (pragmas placed as global declaration) (inf prof (defaultTraceOn)) (inf prof (defaultTraceOff)) (inf prof (subpTraceOn subp1 subp1 ...)) |
protected boolean |
reformHirToParallelize()
Decide how to transform HIR of SubpDefinition indicated by subpFlow so as it can be executed in parallel. |
protected HIR |
rewriteVariables(HIR pNewHir,
java.util.Map pOldSymToNewVarExp)
Rewrite variables in pNewHir according to the map pOldSymToNewVarExp. |
protected java.util.Set |
varNodeToVarSet(java.util.Set pVarNodes)
Change the set of VarNodes to a set of corresponding Vars. |
protected Stmt |
writeVector(Var pFromVar,
Var pToVar,
SymTable pSymTable)
|
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
public final IoRoot ioRoot
public final SymRoot symRoot
public final HirRoot hirRoot
protected HIR hir
protected Sym sym
protected CoinsOptions fCoinsOptions
protected boolean fChanged
public FlowRoot flowRoot
protected LoopParallel fLoopParallel
protected LoopUtil fUtil
protected SubpFlow fSubpFlow
protected SubpFlow subpFlow
protected FlowResults fResults
protected SymTable fSymTableCurrent
protected java.util.List fSubpDefinitionList
protected java.util.Map fStatementsToBeReplaced
protected java.util.Map fStatementsToBeAdded
protected java.util.List fStatementsToBeDeleted
protected java.util.Map fLoopStmtToLoopTable
protected java.util.List fLoopsToBeParallelized
protected int fMaxDegreeOfParallel
protected Type fThreadType
protected Var fThreadDescriptor
protected Var fNumberOfThreads
protected Var fThreadIdArray
protected Var fThreadIdOfMaster
protected boolean fStackInLocalMemory
protected Subp fThreadInit
protected Subp fThreadEnd
protected Subp fThreadPreprocessForDoAllLoop
protected Subp fThreadPostprocess
protected Subp fThreadForkForDoAll
protected Subp fThreadPreprocessForDoAllThread
protected Subp fThreadPostprocessForDoAllThread
protected Subp fThreadJoin
protected Subp fThreadSelfId
protected int fDbgLevel
public final int fMaximumNumberOfReductions
コンストラクタの詳細 |
public ReformHir(HirRoot pHirRoot)
メソッドの詳細 |
public void reformForProfiling()
public void reformForParallel()
protected boolean parallelize(SubpDefinition pSubpDefinition)
pSubpDefinition
- Subprogram definition
requested to be parallelized.
protected boolean reformForInitiation(SubpDefinition pSubpDefinition)
pSubpDefinition
- Subprogram definition
that may contain thread initiation pragma.
protected boolean reformHirToParallelize()
protected void changeLoopToSubprogram(LoopTable pTable)
pTable
- Loop table of the loop to be parallelized.protected SubpDefinition makeSubpDefinition(LoopTable pTable, java.util.List pInLoopVarList, java.util.List pChangeToLocal, java.util.List pChangeToGlobal, java.util.Set pInductionVars, java.util.Set pReductionVarSet, java.util.Set pReductionsToInitiate, java.util.List pPassPointer, java.util.Set pCopyToChild, java.util.Set pCopyBack)
pTable
- Loop table of the loop.pInLoopVarList
- list of variables appering in the loop.pChangeToLocal
- variables to be changed from global to local.pChangeToGlobal
- variables to be changed from local to global.pInductionVars
- set of induction variables in the loop.pReductionVarSet
- set of reduction variables in the loop.pReductionsToInitiate
- set of reduction variables
to be initialized in the generated subprgoram.pPassPointer
- set of variables passing write back receiver
including reductions.pCopyToChild
- set of variables to be copied from parent
to child (neither last private nore reduction).pCopyBack
- set of variabled to be copied from child
to parent (neither last private nore reduction).
protected HIR rewriteVariables(HIR pNewHir, java.util.Map pOldSymToNewVarExp)
pNewHir
- Statement or expression to be changed.pOldSymToNewVarExp
- maps old variable to new variable expression.public Var defineVar(java.lang.String pHeader, Type pType, SymTable pSymTable, Subp pDefinedIn)
public Param defineParam(java.lang.String pHeader, Type pType, SymTable pSymTable)
protected Var getPrimaryInductionVar(ForStmt pForStmt)
pForStmt
- loop statement.
protected Stmt writeVector(Var pFromVar, Var pToVar, SymTable pSymTable)
protected void printLoopTable(LoopTable pTable)
public void printList(java.util.List pList, java.lang.String pHeader)
pList
- list of items to be printed.pHeader
- string explaining the set in short.public void printSet(java.util.Set pSet, java.lang.String pHeader)
pSet
- set of items.pHeader
- header string to be printed.protected java.util.Set varNodeToVarSet(java.util.Set pVarNodes)
pVarNodes
- set of VarNodes.
protected Var getVarOfExp(Exp pExp)
pExp
-
protected java.util.Set getReductionVar(java.util.List pReductionList)
pReductionList
- list of reductions.
protected java.util.List getReductionList(LoopTable pTable)
pTable
- LoopTable of the loop.
protected Reduction getReductionForVar(Var pVar, java.util.List pReductionList)
protected Exp initialValueOfReduction(LoopTable pTable, Var pReductionVar)
protected boolean makeCSourceFromHirBase(java.lang.String timing, HirRoot hirRoot, SymRoot symRoot, IoRoot io) throws java.io.IOException
java.io.IOException
protected void callHirBaseToC(HirRoot hirRoot, SymRoot symRoot, IoRoot io, java.io.OutputStream out) throws java.io.IOException
hirRoot
- an HirRoot object.symRoot
- a SymRoot object.io
- the IoRoot.out
- an OutputStream to which the C source program is written.
java.io.IOException
- any IO error.
PassException
- unrecoverable error(s) found in processing.
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |