Search in sources :

Example 6 with SparkAggType

use of org.apache.sysml.hops.AggBinaryOp.SparkAggType in project incubator-systemml by apache.

the class MapmmSPInstruction method parseInstruction.

public static MapmmSPInstruction parseInstruction(String str) throws DMLRuntimeException {
    String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
    String opcode = parts[0];
    if (!opcode.equalsIgnoreCase(MapMult.OPCODE))
        throw new DMLRuntimeException("MapmmSPInstruction.parseInstruction():: Unknown opcode " + opcode);
    CPOperand in1 = new CPOperand(parts[1]);
    CPOperand in2 = new CPOperand(parts[2]);
    CPOperand out = new CPOperand(parts[3]);
    CacheType type = CacheType.valueOf(parts[4]);
    boolean outputEmpty = Boolean.parseBoolean(parts[5]);
    SparkAggType aggtype = SparkAggType.valueOf(parts[6]);
    AggregateOperator agg = new AggregateOperator(0, Plus.getPlusFnObject());
    AggregateBinaryOperator aggbin = new AggregateBinaryOperator(Multiply.getMultiplyFnObject(), agg);
    return new MapmmSPInstruction(aggbin, in1, in2, out, type, outputEmpty, aggtype, opcode, str);
}
Also used : SparkAggType(org.apache.sysml.hops.AggBinaryOp.SparkAggType) AggregateOperator(org.apache.sysml.runtime.matrix.operators.AggregateOperator) AggregateBinaryOperator(org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator) CPOperand(org.apache.sysml.runtime.instructions.cp.CPOperand) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) CacheType(org.apache.sysml.lops.MapMult.CacheType)

Aggregations

SparkAggType (org.apache.sysml.hops.AggBinaryOp.SparkAggType)6 CPOperand (org.apache.sysml.runtime.instructions.cp.CPOperand)4 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)3 AggregateOperator (org.apache.sysml.runtime.matrix.operators.AggregateOperator)3 Aggregate (org.apache.sysml.lops.Aggregate)2 Group (org.apache.sysml.lops.Group)2 Lop (org.apache.sysml.lops.Lop)2 ExecType (org.apache.sysml.lops.LopProperties.ExecType)2 LopsException (org.apache.sysml.lops.LopsException)2 AggregateBinaryOperator (org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator)2 MultiThreadedHop (org.apache.sysml.hops.Hop.MultiThreadedHop)1 OperationTypes (org.apache.sysml.lops.Aggregate.OperationTypes)1 LixCacheType (org.apache.sysml.lops.LeftIndex.LixCacheType)1 CacheType (org.apache.sysml.lops.MapMult.CacheType)1 PartialAggregate (org.apache.sysml.lops.PartialAggregate)1 CorrectionLocationType (org.apache.sysml.lops.PartialAggregate.CorrectionLocationType)1 DirectionTypes (org.apache.sysml.lops.PartialAggregate.DirectionTypes)1 RangeBasedReIndex (org.apache.sysml.lops.RangeBasedReIndex)1 TernaryAggregate (org.apache.sysml.lops.TernaryAggregate)1 UAggOuterChain (org.apache.sysml.lops.UAggOuterChain)1