Search in sources :

Example 1 with MultipleCP

use of org.apache.sysml.lops.MultipleCP in project incubator-systemml by apache.

the class MultipleOp method constructLops.

/**
	 * Construct the corresponding Lops for this Hop
	 */
@Override
public Lop constructLops() throws HopsException, LopsException {
    // reuse existing lop
    if (getLops() != null)
        return getLops();
    try {
        ArrayList<Hop> inHops = getInput();
        Lop[] inLops = new Lop[inHops.size()];
        for (int i = 0; i < inHops.size(); i++) {
            Hop inHop = inHops.get(i);
            Lop inLop = inHop.constructLops();
            inLops[i] = inLop;
        }
        MultipleCP.OperationType opType = MultipleOperandOperationHopTypeToLopType.get(multipleOperandOperation);
        if (opType == null) {
            throw new HopsException("Unknown MultipleCP Lop operation type for MultipleOperandOperation Hop type '" + multipleOperandOperation + "'");
        }
        MultipleCP multipleCPLop = new MultipleCP(opType, getDataType(), getValueType(), inLops);
        setOutputDimensions(multipleCPLop);
        setLineNumbers(multipleCPLop);
        setLops(multipleCPLop);
    } catch (Exception e) {
        throw new HopsException(this.printErrorLocation() + "error constructing Lops for MultipleOp Hop -- \n ", e);
    }
    // add reblock/checkpoint lops if necessary
    constructAndSetLopsDataFlowProperties();
    return getLops();
}
Also used : MultipleCP(org.apache.sysml.lops.MultipleCP) Lop(org.apache.sysml.lops.Lop) LopsException(org.apache.sysml.lops.LopsException)

Aggregations

Lop (org.apache.sysml.lops.Lop)1 LopsException (org.apache.sysml.lops.LopsException)1 MultipleCP (org.apache.sysml.lops.MultipleCP)1