Search in sources :

Example 21 with AggregateBinaryOperator

use of org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator in project incubator-systemml by apache.

the class AggregateBinaryCPInstruction method processInstruction.

@Override
public void processInstruction(ExecutionContext ec) {
    // get inputs
    MatrixBlock matBlock1 = ec.getMatrixInput(input1.getName(), getExtendedOpcode());
    MatrixBlock matBlock2 = ec.getMatrixInput(input2.getName(), getExtendedOpcode());
    // compute matrix multiplication
    AggregateBinaryOperator ab_op = (AggregateBinaryOperator) _optr;
    MatrixBlock main = (matBlock2 instanceof CompressedMatrixBlock) ? matBlock2 : matBlock1;
    MatrixBlock ret = main.aggregateBinaryOperations(matBlock1, matBlock2, new MatrixBlock(), ab_op);
    // release inputs/outputs
    ec.releaseMatrixInput(input1.getName(), getExtendedOpcode());
    ec.releaseMatrixInput(input2.getName(), getExtendedOpcode());
    ec.setMatrixOutput(output.getName(), ret, getExtendedOpcode());
}
Also used : CompressedMatrixBlock(org.apache.sysml.runtime.compress.CompressedMatrixBlock) CompressedMatrixBlock(org.apache.sysml.runtime.compress.CompressedMatrixBlock) MatrixBlock(org.apache.sysml.runtime.matrix.data.MatrixBlock) AggregateBinaryOperator(org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator)

Aggregations

AggregateBinaryOperator (org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator)21 AggregateOperator (org.apache.sysml.runtime.matrix.operators.AggregateOperator)16 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)10 MatrixBlock (org.apache.sysml.runtime.matrix.data.MatrixBlock)10 CompressedMatrixBlock (org.apache.sysml.runtime.compress.CompressedMatrixBlock)9 CPOperand (org.apache.sysml.runtime.instructions.cp.CPOperand)6 SparkAggType (org.apache.sysml.hops.AggBinaryOp.SparkAggType)2 CacheType (org.apache.sysml.lops.MapMult.CacheType)2 IndexedMatrixValue (org.apache.sysml.runtime.matrix.mapred.IndexedMatrixValue)2 IOException (java.io.IOException)1 MatrixObject (org.apache.sysml.runtime.controlprogram.caching.MatrixObject)1 Multiply (org.apache.sysml.runtime.functionobjects.Multiply)1 Plus (org.apache.sysml.runtime.functionobjects.Plus)1 MatrixIndexes (org.apache.sysml.runtime.matrix.data.MatrixIndexes)1 MatrixValue (org.apache.sysml.runtime.matrix.data.MatrixValue)1 DistributedCacheInput (org.apache.sysml.runtime.matrix.mapred.DistributedCacheInput)1