Package org.apache.sysds.hops.ipa
Class FunctionCallSizeInfo
java.lang.Object
org.apache.sysds.hops.ipa.FunctionCallSizeInfo
Auxiliary data structure to hold function call summaries in terms
of information about number of function calls, consistent dimensions,
consistent sparsity, and dimension-preserving functions.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the function call summary for all functions reachable from the main program.FunctionCallSizeInfo(FunctionCallGraph fgraph, boolean init) Constructs the function call summary for all functions reachable from the main program. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a function to the set of dimension-preserving functions.booleanGets the set of dimension-preserving functions, i.e., functions with one matrix input and output of equal dimension sizes.intgetFunctionCallCount(String fkey) Gets the number of function calls to a given function.Gets the set of functions that are invalid for statistics propagation.Gets the set of functions that are valid for statistics propagation.inthashCode()booleanhasSafeLiterals(String fkey) Indicates if the given function has at least one input that allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.booleanIndicates if the given function belongs to the set of dimension-preserving functions.booleanisSafeLiteral(String fkey, int pos) Indicates if the given function input allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.booleanIndicates if the given function input allows for safe nnz propagation, i.e., all function calls have a consistent number of non-zeros.booleanisValidFunction(String fkey) Indicates if the given function is valid for statistics propagation.toString()
-
Constructor Details
-
FunctionCallSizeInfo
Constructs the function call summary for all functions reachable from the main program.- Parameters:
fgraph- function call graph
-
FunctionCallSizeInfo
Constructs the function call summary for all functions reachable from the main program.- Parameters:
fgraph- function call graphinit- initialize function candidates
-
-
Method Details
-
getFunctionCallCount
Gets the number of function calls to a given function.- Parameters:
fkey- function key- Returns:
- number of function calls
-
isValidFunction
Indicates if the given function is valid for statistics propagation.- Parameters:
fkey- function key- Returns:
- true if valid
-
getValidFunctions
Gets the set of functions that are valid for statistics propagation.- Returns:
- set of function keys
-
getInvalidFunctions
Gets the set of functions that are invalid for statistics propagation. This is literally the set of reachable functions minus the set of valid functions.- Returns:
- set of function keys.
-
addDimsPreservingFunction
Adds a function to the set of dimension-preserving functions.- Parameters:
fkey- function key
-
getDimsPreservingFunctions
Gets the set of dimension-preserving functions, i.e., functions with one matrix input and output of equal dimension sizes.- Returns:
- set of function keys
-
isDimsPreservingFunction
Indicates if the given function belongs to the set of dimension-preserving functions.- Parameters:
fkey- function key- Returns:
- true if the function is dimension-preserving
-
isSafeNnz
Indicates if the given function input allows for safe nnz propagation, i.e., all function calls have a consistent number of non-zeros.- Parameters:
fkey- function keypos- function input position- Returns:
- true if nnz can safely be propagated
-
hasSafeLiterals
Indicates if the given function has at least one input that allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.- Parameters:
fkey- function key- Returns:
- true if a literal can be safely propagated
-
isSafeLiteral
Indicates if the given function input allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.- Parameters:
fkey- function keypos- function input position- Returns:
- true if literal that can be safely propagated
-
hashCode
public int hashCode() -
equals
-
toString
-