Class ProgramRecompiler
java.lang.Object
org.apache.sysds.runtime.controlprogram.parfor.opt.ProgramRecompiler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic 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 voidstatic 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.
-
Constructor Details
-
ProgramRecompiler
public ProgramRecompiler()
-
-
Method Details
-
generatePartitialRuntimeProgram
public static ArrayList<ProgramBlock> generatePartitialRuntimeProgram(Program rtprog, ArrayList<StatementBlock> sbs) -
rFindAndRecompileIndexingHOP
public 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 blockpb- program blockvar- variableec- execution contextforce- if true, set and recompile the respective indexing hops
-
getReusableScalarVariables
public static LocalVariableMap getReusableScalarVariables(DMLProgram prog, StatementBlock parforSB, LocalVariableMap vars) -
replaceConstantScalarVariables
-
isApplicableForReuseVariable
public 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 programparforSB- parfor statement blockvar- variable- Returns:
- true if can reuse variable
-
containsAtLeastOneFunction
-