Package org.apache.sysds.hops.rewrite
Class ProgramRewriter
java.lang.Object
org.apache.sysds.hops.rewrite.ProgramRewriter
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
ConstructorsConstructorDescriptionProgramRewriter(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
Modifier and TypeMethodDescriptionvoidremoveHopRewrite(Class<? extends HopRewriteRule> clazz) voidremoveStatementBlockRewrite(Class<? extends StatementBlockRewriteRule> clazz) rewriteHopDAG(ArrayList<Hop> roots, ProgramRewriteStatus state) rewriteHopDAG(Hop root, ProgramRewriteStatus state) voidrewriteHopDAGsFunction(FunctionStatementBlock fsb, boolean splitDags) voidrewriteHopDAGsFunction(FunctionStatementBlock fsb, ProgramRewriteStatus state, boolean splitDags) rewriteProgramHopDAGs(DMLProgram dmlp, boolean splitDags) rewriteProgramHopDAGs(DMLProgram dmlp, boolean splitDags, ProgramRewriteStatus state) rRewriteStatementBlock(StatementBlock sb, ProgramRewriteStatus status, boolean splitDags) voidrRewriteStatementBlockHopDAGs(StatementBlock current, ProgramRewriteStatus state) rRewriteStatementBlocks(ArrayList<StatementBlock> sbs, ProgramRewriteStatus status, boolean splitDags)
-
Constructor Details
-
ProgramRewriter
public ProgramRewriter() -
ProgramRewriter
public ProgramRewriter(boolean staticRewrites, boolean dynamicRewrites) -
ProgramRewriter
Construct a program rewriter for a given rewrite which is passed from outside.- Parameters:
rewrites- the HOP rewrite rules
-
ProgramRewriter
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 Details
-
removeHopRewrite
-
removeStatementBlockRewrite
-
rewriteProgramHopDAGs
-
rewriteProgramHopDAGs
-
rewriteProgramHopDAGs
public ProgramRewriteStatus rewriteProgramHopDAGs(DMLProgram dmlp, boolean splitDags, ProgramRewriteStatus state) -
rewriteHopDAGsFunction
-
rewriteHopDAGsFunction
public void rewriteHopDAGsFunction(FunctionStatementBlock fsb, ProgramRewriteStatus state, boolean splitDags) -
rRewriteStatementBlockHopDAGs
-
rewriteHopDAG
-
rewriteHopDAG
-
rRewriteStatementBlocks
public ArrayList<StatementBlock> rRewriteStatementBlocks(ArrayList<StatementBlock> sbs, ProgramRewriteStatus status, boolean splitDags) -
rRewriteStatementBlock
public ArrayList<StatementBlock> rRewriteStatementBlock(StatementBlock sb, ProgramRewriteStatus status, boolean splitDags)
-