use of org.apache.sysml.hops.LeftIndexingOp in project incubator-systemml by apache.
the class OptimizerRuleBased method rGetUIPConsumerList.
private void rGetUIPConsumerList(Hop hop, HashMap<String, ArrayList<UIPCandidateHop>> uipCandHopHM) throws DMLRuntimeException {
if (hop.isVisited())
return;
if ((!(!hop.getParent().isEmpty() && hop.getParent().get(0) instanceof LeftIndexingOp)) && ((hop instanceof DataOp && ((DataOp) hop).getDataOpType() == DataOpTypes.TRANSIENTREAD) || (hop instanceof ReorgOp && (((ReorgOp) hop).getOp() == ReOrgOp.RESHAPE || ((ReorgOp) hop).getOp() == ReOrgOp.TRANSPOSE)) || (hop instanceof FunctionOp))) {
// If candidate's name is same as input hop.
String uipCandiateID = hop.getName();
ArrayList<UIPCandidateHop> uipCandHopList = uipCandHopHM.get(uipCandiateID);
if (uipCandHopList != null) {
for (UIPCandidateHop uipCandHop : uipCandHopList) {
// Add consumers for candidate hop.
ArrayList<Hop> consumerHops = uipCandHop.getConsumerHops();
if (uipCandHop.getConsumerHops() == null)
consumerHops = new ArrayList<Hop>();
consumerHops.add(getRootHop(hop));
uipCandHop.setConsumerHops(consumerHops);
}
}
}
for (Hop hopIn : hop.getInput()) rGetUIPConsumerList(hopIn, uipCandHopHM);
hop.setVisited();
}
Aggregations