Package org.apache.sysds.hops.rewrite
Class ProgramRewriter
- java.lang.Object
 - 
- org.apache.sysds.hops.rewrite.ProgramRewriter
 
 
- 
public class ProgramRewriter extends Object
This program rewriter applies a variety of rule-based rewrites on all hop dags of the given program in one pass over the entire program. 
- 
- 
Constructor Summary
Constructors Constructor Description ProgramRewriter()ProgramRewriter(boolean staticRewrites, boolean dynamicRewrites)ProgramRewriter(ArrayList<HopRewriteRule> hRewrites, ArrayList<StatementBlockRewriteRule> sbRewrites)Construct a program rewriter for the given rewrite sets which are passed from outside.ProgramRewriter(HopRewriteRule... rewrites)Construct a program rewriter for a given rewrite which is passed from outside.ProgramRewriter(StatementBlockRewriteRule... rewrites)Construct a program rewriter for a given rewrite which is passed from outside. 
- 
Method Summary
 
 - 
 
- 
- 
Constructor Detail
- 
ProgramRewriter
public ProgramRewriter()
 
- 
ProgramRewriter
public ProgramRewriter(boolean staticRewrites, boolean dynamicRewrites) 
- 
ProgramRewriter
public ProgramRewriter(HopRewriteRule... rewrites)
Construct a program rewriter for a given rewrite which is passed from outside.- Parameters:
 rewrites- the HOP rewrite rules
 
- 
ProgramRewriter
public ProgramRewriter(StatementBlockRewriteRule... rewrites)
Construct a program rewriter for a given rewrite which is passed from outside.- Parameters:
 rewrites- the statement block rewrite rules
 
- 
ProgramRewriter
public ProgramRewriter(ArrayList<HopRewriteRule> hRewrites, ArrayList<StatementBlockRewriteRule> sbRewrites)
Construct a program rewriter for the given rewrite sets which are passed from outside.- Parameters:
 hRewrites- HOP rewrite rulessbRewrites- statement block rewrite rules
 
 - 
 
- 
Method Detail
- 
removeHopRewrite
public void removeHopRewrite(Class<? extends HopRewriteRule> clazz)
 
- 
removeStatementBlockRewrite
public void removeStatementBlockRewrite(Class<? extends StatementBlockRewriteRule> clazz)
 
- 
rewriteProgramHopDAGs
public ProgramRewriteStatus rewriteProgramHopDAGs(DMLProgram dmlp)
 
- 
rewriteProgramHopDAGs
public ProgramRewriteStatus rewriteProgramHopDAGs(DMLProgram dmlp, boolean splitDags)
 
- 
rewriteProgramHopDAGs
public ProgramRewriteStatus rewriteProgramHopDAGs(DMLProgram dmlp, boolean splitDags, ProgramRewriteStatus state)
 
- 
rewriteHopDAGsFunction
public void rewriteHopDAGsFunction(FunctionStatementBlock fsb, boolean splitDags)
 
- 
rewriteHopDAGsFunction
public void rewriteHopDAGsFunction(FunctionStatementBlock fsb, ProgramRewriteStatus state, boolean splitDags)
 
- 
rRewriteStatementBlockHopDAGs
public void rRewriteStatementBlockHopDAGs(StatementBlock current, ProgramRewriteStatus state)
 
- 
rewriteHopDAG
public ArrayList<Hop> rewriteHopDAG(ArrayList<Hop> roots, ProgramRewriteStatus state)
 
- 
rewriteHopDAG
public Hop rewriteHopDAG(Hop root, ProgramRewriteStatus state)
 
- 
rRewriteStatementBlocks
public ArrayList<StatementBlock> rRewriteStatementBlocks(ArrayList<StatementBlock> sbs, ProgramRewriteStatus status, boolean splitDags)
 
- 
rRewriteStatementBlock
public ArrayList<StatementBlock> rRewriteStatementBlock(StatementBlock sb, ProgramRewriteStatus status, boolean splitDags)
 
 - 
 
 -