public class InstructionUtils extends Object
Constructor and Description |
---|
InstructionUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
checkNumFields(String[] parts,
int expected) |
static int |
checkNumFields(String[] parts,
int expected1,
int expected2) |
static int |
checkNumFields(String str,
int expected) |
static int |
checkNumFields(String str,
int expected1,
int expected2) |
static org.apache.sysml.lops.PartialAggregate.CorrectionLocationType |
deriveAggregateOperatorCorrectionLocation(String opcode) |
static String |
deriveAggregateOperatorOpcode(String opcode) |
static org.apache.sysml.runtime.instructions.cp.CPInstruction.CPINSTRUCTION_TYPE |
getCPType(String str) |
static GPUInstruction.GPUINSTRUCTION_TYPE |
getGPUType(String str) |
static String[] |
getInstructionParts(String str)
Given an instruction string, strip-off the execution type and return
opcode and all input/output operands WITHOUT their data/value type.
|
static String[] |
getInstructionPartsWithValueType(String str)
Given an instruction string, this function strips-off the
execution type (CP or MR) and returns the remaining parts,
which include the opcode as well as the input and output operands.
|
static org.apache.sysml.runtime.instructions.mr.MRInstruction.MRINSTRUCTION_TYPE |
getMRType(String str) |
static String |
getOpCode(String str) |
static SPInstruction.SPINSTRUCTION_TYPE |
getSPType(String str) |
static boolean |
isBuiltinFunction(String opcode) |
static boolean |
isDistQuaternaryOpcode(String opcode) |
static boolean |
isDistributedCacheUsed(String str)
Evaluates if at least one instruction of the given instruction set
used the distributed cache; this call can also be used for individual
instructions.
|
static org.apache.sysml.runtime.matrix.operators.AggregateOperator |
parseAggregateOperator(String opcode,
String corrExists,
String corrLoc) |
static org.apache.sysml.runtime.matrix.operators.AggregateTernaryOperator |
parseAggregateTernaryOperator(String opcode) |
static org.apache.sysml.runtime.matrix.operators.AggregateTernaryOperator |
parseAggregateTernaryOperator(String opcode,
int numThreads) |
static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator |
parseBasicAggregateUnaryOperator(String opcode) |
static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator |
parseBasicCumulativeAggregateUnaryOperator(org.apache.sysml.runtime.matrix.operators.UnaryOperator uop) |
static org.apache.sysml.runtime.matrix.operators.BinaryOperator |
parseBinaryOperator(String opcode) |
static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator |
parseCumulativeAggregateUnaryOperator(String opcode) |
static org.apache.sysml.runtime.matrix.operators.BinaryOperator |
parseExtendedBinaryOperator(String opcode) |
static org.apache.sysml.runtime.matrix.operators.ScalarOperator |
parseScalarBinaryOperator(String opcode,
boolean arg1IsScalar)
scalar-matrix operator
|
static org.apache.sysml.runtime.matrix.operators.ScalarOperator |
parseScalarBinaryOperator(String opcode,
boolean arg1IsScalar,
double constant)
scalar-matrix operator
|
public static int checkNumFields(String str, int expected) throws DMLRuntimeException
DMLRuntimeException
public static int checkNumFields(String[] parts, int expected) throws DMLRuntimeException
DMLRuntimeException
public static int checkNumFields(String[] parts, int expected1, int expected2) throws DMLRuntimeException
DMLRuntimeException
public static int checkNumFields(String str, int expected1, int expected2) throws DMLRuntimeException
DMLRuntimeException
public static String[] getInstructionParts(String str)
str
- instruction stringpublic static String[] getInstructionPartsWithValueType(String str)
str
- instruction stringpublic static org.apache.sysml.runtime.instructions.mr.MRInstruction.MRINSTRUCTION_TYPE getMRType(String str)
public static SPInstruction.SPINSTRUCTION_TYPE getSPType(String str)
public static org.apache.sysml.runtime.instructions.cp.CPInstruction.CPINSTRUCTION_TYPE getCPType(String str)
public static GPUInstruction.GPUINSTRUCTION_TYPE getGPUType(String str)
public static boolean isBuiltinFunction(String opcode)
public static boolean isDistributedCacheUsed(String str)
str
- instruction setpublic static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator parseBasicAggregateUnaryOperator(String opcode)
public static org.apache.sysml.runtime.matrix.operators.AggregateTernaryOperator parseAggregateTernaryOperator(String opcode)
public static org.apache.sysml.runtime.matrix.operators.AggregateTernaryOperator parseAggregateTernaryOperator(String opcode, int numThreads)
public static org.apache.sysml.runtime.matrix.operators.AggregateOperator parseAggregateOperator(String opcode, String corrExists, String corrLoc)
public static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator parseBasicCumulativeAggregateUnaryOperator(org.apache.sysml.runtime.matrix.operators.UnaryOperator uop)
public static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator parseCumulativeAggregateUnaryOperator(String opcode)
public static org.apache.sysml.runtime.matrix.operators.BinaryOperator parseBinaryOperator(String opcode) throws DMLRuntimeException
DMLRuntimeException
public static org.apache.sysml.runtime.matrix.operators.ScalarOperator parseScalarBinaryOperator(String opcode, boolean arg1IsScalar) throws DMLRuntimeException
opcode
- the opcodearg1IsScalar
- ?DMLRuntimeException
- if DMLRuntimeException occurspublic static org.apache.sysml.runtime.matrix.operators.ScalarOperator parseScalarBinaryOperator(String opcode, boolean arg1IsScalar, double constant) throws DMLRuntimeException
opcode
- the opcodearg1IsScalar
- ?constant
- ?DMLRuntimeException
- if DMLRuntimeException occurspublic static org.apache.sysml.runtime.matrix.operators.BinaryOperator parseExtendedBinaryOperator(String opcode) throws DMLRuntimeException
DMLRuntimeException
public static org.apache.sysml.lops.PartialAggregate.CorrectionLocationType deriveAggregateOperatorCorrectionLocation(String opcode)
public static boolean isDistQuaternaryOpcode(String opcode)
Copyright © 2017 The Apache Software Foundation. All rights reserved.