Search in sources :

Example 1 with AppendGAlignedSP

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

the class BinaryOp method constructSPAppendLop.

public static Lop constructSPAppendLop(Hop left, Hop right, DataType dt, ValueType vt, boolean cbind, Hop current) throws HopsException, LopsException {
    Lop ret = null;
    //offset 1st input
    Lop offset = createOffsetLop(left, cbind);
    AppendMethod am = optFindAppendSPMethod(left.getDim1(), left.getDim2(), right.getDim1(), right.getDim2(), right.getRowsInBlock(), right.getColsInBlock(), right.getNnz(), cbind, dt);
    switch(am) {
        case //special case map-only append
        MR_MAPPEND:
            {
                ret = new AppendM(left.constructLops(), right.constructLops(), offset, current.getDataType(), current.getValueType(), cbind, false, ExecType.SPARK);
                break;
            }
        case //special case reduce append w/ one column block
        MR_RAPPEND:
            {
                ret = new AppendR(left.constructLops(), right.constructLops(), current.getDataType(), current.getValueType(), cbind, ExecType.SPARK);
                break;
            }
        case MR_GAPPEND:
            {
                //offset second input
                Lop offset2 = createOffsetLop(right, cbind);
                ret = new AppendG(left.constructLops(), right.constructLops(), offset, offset2, current.getDataType(), current.getValueType(), cbind, ExecType.SPARK);
                break;
            }
        case SP_GAlignedAppend:
            {
                ret = new AppendGAlignedSP(left.constructLops(), right.constructLops(), offset, current.getDataType(), current.getValueType(), cbind);
                break;
            }
        default:
            throw new HopsException("Invalid SP append method: " + am);
    }
    ret.setAllPositions(current.getBeginLine(), current.getBeginColumn(), current.getEndLine(), current.getEndColumn());
    return ret;
}
Also used : AppendG(org.apache.sysml.lops.AppendG) AppendR(org.apache.sysml.lops.AppendR) Lop(org.apache.sysml.lops.Lop) AppendGAlignedSP(org.apache.sysml.lops.AppendGAlignedSP) AppendM(org.apache.sysml.lops.AppendM)

Aggregations

AppendG (org.apache.sysml.lops.AppendG)1 AppendGAlignedSP (org.apache.sysml.lops.AppendGAlignedSP)1 AppendM (org.apache.sysml.lops.AppendM)1 AppendR (org.apache.sysml.lops.AppendR)1 Lop (org.apache.sysml.lops.Lop)1