7070
7171public class MultiReturnParameterizedBuiltinFEDInstruction extends ComputationFEDInstruction {
7272 protected final List <CPOperand > _outputs ;
73-
73+ protected final boolean _metaReturn ;
74+
7475 private MultiReturnParameterizedBuiltinFEDInstruction (Operator op , CPOperand input1 , CPOperand input2 ,
75- List <CPOperand > outputs , String opcode , String istr ) {
76+ List <CPOperand > outputs , boolean metaReturn , String opcode , String istr ) {
7677 super (FEDType .MultiReturnParameterizedBuiltin , op , input1 , input2 , null , opcode , istr );
78+ _metaReturn = metaReturn ;
7779 _outputs = outputs ;
7880 }
7981
@@ -104,13 +106,13 @@ public static MultiReturnParameterizedBuiltinFEDInstruction parseInstruction(
104106 private static MultiReturnParameterizedBuiltinFEDInstruction parseInstruction (
105107 MultiReturnParameterizedBuiltinCPInstruction instr ) {
106108 return new MultiReturnParameterizedBuiltinFEDInstruction (instr .getOperator (), instr .input1 , instr .input2 ,
107- instr .getOutputs (), instr .getOpcode (), instr .getInstructionString ());
109+ instr .getOutputs (), instr .getMetaReturn (), instr . getOpcode (), instr .getInstructionString ());
108110 }
109111
110112 private static MultiReturnParameterizedBuiltinFEDInstruction parseInstruction (
111113 MultiReturnParameterizedBuiltinSPInstruction instr ) {
112114 return new MultiReturnParameterizedBuiltinFEDInstruction (instr .getOperator (), instr .input1 , instr .input2 ,
113- instr .getOutputs (), instr .getOpcode (), instr .getInstructionString ());
115+ instr .getOutputs (), instr .getMetaReturn (), instr . getOpcode (), instr .getInstructionString ());
114116 }
115117
116118 public static MultiReturnParameterizedBuiltinFEDInstruction parseInstruction (String str ) {
@@ -122,9 +124,15 @@ public static MultiReturnParameterizedBuiltinFEDInstruction parseInstruction(Str
122124 // one input and two outputs
123125 CPOperand in1 = new CPOperand (parts [1 ]);
124126 CPOperand in2 = new CPOperand (parts [2 ]);
125- outputs .add (new CPOperand (parts [3 ], Types .ValueType .FP64 , Types .DataType .MATRIX ));
126- outputs .add (new CPOperand (parts [4 ], Types .ValueType .STRING , Types .DataType .FRAME ));
127- return new MultiReturnParameterizedBuiltinFEDInstruction (null , in1 , in2 , outputs , opcode , str );
127+ int pos = 3 ;
128+ boolean metaReturn = true ;
129+ System .out .println (Arrays .toString (parts ));
130+ if ( parts .length == 7 ) //no need for meta data
131+ metaReturn = new CPOperand (parts [pos ++]).getLiteral ().getBooleanValue ();
132+ outputs .add (new CPOperand (parts [pos ], Types .ValueType .FP64 , Types .DataType .MATRIX ));
133+ outputs .add (new CPOperand (parts [pos +1 ], Types .ValueType .STRING , Types .DataType .FRAME ));
134+ return new MultiReturnParameterizedBuiltinFEDInstruction (
135+ null , in1 , in2 , outputs , metaReturn , opcode , str );
128136 }
129137 else {
130138 throw new DMLRuntimeException ("Invalid opcode in MultiReturnBuiltin instruction: " + opcode );
@@ -198,7 +206,7 @@ public void processInstruction(ExecutionContext ec) {
198206 encodeFederatedFrames (fedMapping , globalEncoder , ec .getMatrixObject (getOutput (0 )));
199207
200208 // release input and outputs
201- ec .setFrameOutput (getOutput (1 ).getName (), meta );
209+ ec .setFrameOutput (getOutput (1 ).getName (), _metaReturn ? meta : new FrameBlock () );
202210 }
203211
204212 private class EncoderColnames {
0 commit comments