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.CPType |
getCPType(String str) |
static org.apache.sysml.lops.LopProperties.ExecType |
getExecType(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.matrix.operators.AggregateBinaryOperator |
getMatMultOperator(int k) |
static org.apache.sysml.runtime.instructions.mr.MRInstruction.MRType |
getMRType(String str) |
static String |
getOpCode(String str) |
static SPInstruction.SPType |
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 |
parseBasicAggregateUnaryOperator(String opcode,
int numThreads) |
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.Operator |
parseBinaryOrBuiltinOperator(String opcode,
org.apache.sysml.runtime.instructions.cp.CPOperand in1,
org.apache.sysml.runtime.instructions.cp.CPOperand in2) |
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.Operator |
parseExtendedBinaryOrBuiltinOperator(String opcode,
org.apache.sysml.runtime.instructions.cp.CPOperand in1,
org.apache.sysml.runtime.instructions.cp.CPOperand in2) |
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
|
static org.apache.sysml.runtime.matrix.operators.TernaryOperator |
parseTernaryOperator(String opcode) |
static org.apache.sysml.runtime.matrix.operators.UnaryOperator |
parseUnaryOperator(String opcode) |
public static int checkNumFields(String str, int expected)
public static int checkNumFields(String[] parts, int expected)
public static int checkNumFields(String[] parts, int expected1, int expected2)
public static int checkNumFields(String str, int expected1, int expected2)
public static String[] getInstructionParts(String str)
str
- instruction stringpublic static String[] getInstructionPartsWithValueType(String str)
str
- instruction stringpublic static org.apache.sysml.lops.LopProperties.ExecType getExecType(String str)
public static org.apache.sysml.runtime.instructions.mr.MRInstruction.MRType getMRType(String str)
public static SPInstruction.SPType getSPType(String str)
public static org.apache.sysml.runtime.instructions.cp.CPInstruction.CPType 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.AggregateUnaryOperator parseBasicAggregateUnaryOperator(String opcode, int numThreads)
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.UnaryOperator parseUnaryOperator(String opcode)
public static org.apache.sysml.runtime.matrix.operators.Operator parseBinaryOrBuiltinOperator(String opcode, org.apache.sysml.runtime.instructions.cp.CPOperand in1, org.apache.sysml.runtime.instructions.cp.CPOperand in2)
public static org.apache.sysml.runtime.matrix.operators.Operator parseExtendedBinaryOrBuiltinOperator(String opcode, org.apache.sysml.runtime.instructions.cp.CPOperand in1, org.apache.sysml.runtime.instructions.cp.CPOperand in2)
public static org.apache.sysml.runtime.matrix.operators.BinaryOperator parseBinaryOperator(String opcode)
public static org.apache.sysml.runtime.matrix.operators.TernaryOperator parseTernaryOperator(String opcode)
public static org.apache.sysml.runtime.matrix.operators.ScalarOperator parseScalarBinaryOperator(String opcode, boolean arg1IsScalar)
opcode
- the opcodearg1IsScalar
- ?public static org.apache.sysml.runtime.matrix.operators.ScalarOperator parseScalarBinaryOperator(String opcode, boolean arg1IsScalar, double constant)
opcode
- the opcodearg1IsScalar
- ?constant
- ?public static org.apache.sysml.runtime.matrix.operators.BinaryOperator parseExtendedBinaryOperator(String opcode)
public static org.apache.sysml.lops.PartialAggregate.CorrectionLocationType deriveAggregateOperatorCorrectionLocation(String opcode)
public static boolean isDistQuaternaryOpcode(String opcode)
public static org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator getMatMultOperator(int k)
Copyright © 2018 The Apache Software Foundation. All rights reserved.