Search in sources :

Example 16 with LeftIndexingOp

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();
}
Also used : ReorgOp(org.apache.sysml.hops.ReorgOp) Hop(org.apache.sysml.hops.Hop) MultiThreadedHop(org.apache.sysml.hops.Hop.MultiThreadedHop) ArrayList(java.util.ArrayList) FunctionOp(org.apache.sysml.hops.FunctionOp) DataOp(org.apache.sysml.hops.DataOp) LeftIndexingOp(org.apache.sysml.hops.LeftIndexingOp)

Aggregations

LeftIndexingOp (org.apache.sysml.hops.LeftIndexingOp)16 Hop (org.apache.sysml.hops.Hop)10 LiteralOp (org.apache.sysml.hops.LiteralOp)7 IndexingOp (org.apache.sysml.hops.IndexingOp)6 DataOp (org.apache.sysml.hops.DataOp)4 MatrixObject (org.apache.sysml.runtime.controlprogram.caching.MatrixObject)4 ArrayList (java.util.ArrayList)3 ForStatementBlock (org.apache.sysml.parser.ForStatementBlock)3 IfStatementBlock (org.apache.sysml.parser.IfStatementBlock)3 StatementBlock (org.apache.sysml.parser.StatementBlock)3 WhileStatementBlock (org.apache.sysml.parser.WhileStatementBlock)3 AggUnaryOp (org.apache.sysml.hops.AggUnaryOp)2 BinaryOp (org.apache.sysml.hops.BinaryOp)2 UnaryOp (org.apache.sysml.hops.UnaryOp)2 AggBinaryOp (org.apache.sysml.hops.AggBinaryOp)1 FunctionOp (org.apache.sysml.hops.FunctionOp)1 MultiThreadedHop (org.apache.sysml.hops.Hop.MultiThreadedHop)1 ReorgOp (org.apache.sysml.hops.ReorgOp)1