Class ProgramRecompiler
- java.lang.Object
- 
- org.apache.sysds.runtime.controlprogram.parfor.opt.ProgramRecompiler
 
- 
 public class ProgramRecompiler extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description ProgramRecompiler()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontainsAtLeastOneFunction(ProgramBlock pb)static ArrayList<ProgramBlock>generatePartitialRuntimeProgram(Program rtprog, ArrayList<StatementBlock> sbs)static LocalVariableMapgetReusableScalarVariables(DMLProgram prog, StatementBlock parforSB, LocalVariableMap vars)static booleanisApplicableForReuseVariable(DMLProgram prog, StatementBlock parforSB, String var)This function determines if an parfor input variable is guaranteed to be read-only across multiple invocations of parfor optimization (e.g., in a surrounding while loop).static voidreplaceConstantScalarVariables(StatementBlock sb, LocalVariableMap vars)static voidrFindAndRecompileIndexingHOP(StatementBlock sb, ProgramBlock pb, String var, ExecutionContext ec, boolean force)NOTE: if force is set, we set and recompile the respective indexing hops; otherwise, we release the forced exec type and recompile again.
 
- 
- 
- 
Method Detail- 
generatePartitialRuntimeProgrampublic static ArrayList<ProgramBlock> generatePartitialRuntimeProgram(Program rtprog, ArrayList<StatementBlock> sbs) 
 - 
rFindAndRecompileIndexingHOPpublic static void rFindAndRecompileIndexingHOP(StatementBlock sb, ProgramBlock pb, String var, ExecutionContext ec, boolean force) NOTE: if force is set, we set and recompile the respective indexing hops; otherwise, we release the forced exec type and recompile again. Hence, any changes can be exactly reverted with the same access behavior.- Parameters:
- sb- statement block
- pb- program block
- var- variable
- ec- execution context
- force- if true, set and recompile the respective indexing hops
 
 - 
getReusableScalarVariablespublic static LocalVariableMap getReusableScalarVariables(DMLProgram prog, StatementBlock parforSB, LocalVariableMap vars) 
 - 
replaceConstantScalarVariablespublic static void replaceConstantScalarVariables(StatementBlock sb, LocalVariableMap vars) 
 - 
isApplicableForReuseVariablepublic static boolean isApplicableForReuseVariable(DMLProgram prog, StatementBlock parforSB, String var) This function determines if an parfor input variable is guaranteed to be read-only across multiple invocations of parfor optimization (e.g., in a surrounding while loop). In case of invariant variables we can reuse partitioned matrices and propagate constants for better size estimation.- Parameters:
- prog- dml program
- parforSB- parfor statement block
- var- variable
- Returns:
- true if can reuse variable
 
 - 
containsAtLeastOneFunctionpublic static boolean containsAtLeastOneFunction(ProgramBlock pb) 
 
- 
 
-