org.apache.sysml.runtime.instructions

Class InstructionUtils



  • public class InstructionUtils
    extends Object
    • Constructor Detail

      • InstructionUtils

        public InstructionUtils()
    • Method Detail

      • getInstructionParts

        public 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. i.e., ret.length = parts.length-1 (-1 for execution type)
        Parameters:
        str - instruction string
        Returns:
        instruction parts as string array
      • getInstructionPartsWithValueType

        public 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. Each returned part will have the datatype and valuetype associated with the operand. This function is invoked mainly for parsing CPInstructions.
        Parameters:
        str - instruction string
        Returns:
        instruction parts as string array
      • getMRType

        public static org.apache.sysml.runtime.instructions.mr.MRInstruction.MRINSTRUCTION_TYPE getMRType(String str)
      • getCPType

        public static org.apache.sysml.runtime.instructions.cp.CPInstruction.CPINSTRUCTION_TYPE getCPType(String str)
      • isBuiltinFunction

        public static boolean isBuiltinFunction(String opcode)
      • isDistributedCacheUsed

        public 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.
        Parameters:
        str - instruction set
        Returns:
        true if at least one instruction uses distributed cache
      • parseBasicAggregateUnaryOperator

        public static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator parseBasicAggregateUnaryOperator(String opcode)
      • parseAggregateTernaryOperator

        public static org.apache.sysml.runtime.matrix.operators.AggregateTernaryOperator parseAggregateTernaryOperator(String opcode)
      • parseAggregateTernaryOperator

        public static org.apache.sysml.runtime.matrix.operators.AggregateTernaryOperator parseAggregateTernaryOperator(String opcode,
                                                                                                                       int numThreads)
      • parseAggregateOperator

        public static org.apache.sysml.runtime.matrix.operators.AggregateOperator parseAggregateOperator(String opcode,
                                                                                                         String corrExists,
                                                                                                         String corrLoc)
      • parseBasicCumulativeAggregateUnaryOperator

        public static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator parseBasicCumulativeAggregateUnaryOperator(org.apache.sysml.runtime.matrix.operators.UnaryOperator uop)
      • parseCumulativeAggregateUnaryOperator

        public static org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator parseCumulativeAggregateUnaryOperator(String opcode)
      • parseScalarBinaryOperator

        public static org.apache.sysml.runtime.matrix.operators.ScalarOperator parseScalarBinaryOperator(String opcode,
                                                                                                         boolean arg1IsScalar)
                                                                                                  throws DMLRuntimeException
        scalar-matrix operator
        Parameters:
        opcode - the opcode
        arg1IsScalar - ?
        Returns:
        scalar operator
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • parseScalarBinaryOperator

        public static org.apache.sysml.runtime.matrix.operators.ScalarOperator parseScalarBinaryOperator(String opcode,
                                                                                                         boolean arg1IsScalar,
                                                                                                         double constant)
                                                                                                  throws DMLRuntimeException
        scalar-matrix operator
        Parameters:
        opcode - the opcode
        arg1IsScalar - ?
        constant - ?
        Returns:
        scalar operator
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • deriveAggregateOperatorOpcode

        public static String deriveAggregateOperatorOpcode(String opcode)
      • deriveAggregateOperatorCorrectionLocation

        public static org.apache.sysml.lops.PartialAggregate.CorrectionLocationType deriveAggregateOperatorCorrectionLocation(String opcode)
      • isDistQuaternaryOpcode

        public static boolean isDistQuaternaryOpcode(String opcode)

Copyright © 2017 The Apache Software Foundation. All rights reserved.