Uploaded image for project: 'SystemDS'
  1. SystemDS
  2. SYSTEMDS-2864

Constant Class and Documentation for Opcodes

    XMLWordPrintableJSON

Details

    Description

      The Instruction subclasses have opcodes which are strings used to identify the type of operation in the instruction. These strings are used when parsing and processing the instructions, but they are also used to describe the execution plan when using the EXPLAIN keyword.
      The strings are written directly in the code where needed, but the strings are well-defined in the sense that when an operation has been given a certain string, this string should be the same for all instructions where that operation is used.
      This makes a good case for having a constants class with each opcode defined as a string. All classes referring to an opcode should refer to this constants class instead of specifying the string directly in the code.

      The CPInstructionParser has the relation between OpCode and CPType for the CPInstructions, so this could give an overview of the different opcodes in the system. Likewise there is InstructionParsers for the other instruction types (FED, SP, and GPU).
      The constants class for the opcodes should be placed in the directory: src/main/java/org/apache/sysds/runtime/instructions/.
      To ensure that the constants are compile time constants and available to all classes, the constants class should be public final and the constants should be public static final.

      The next step is to write documentation for the opcodes. This will guide a user when looking at the execution plans and help the SystemDS developers in understanding the different operations and find the corresponding instructions.
      In docs/site/, add a markdown file containing a table with the columns "OpCode", "Instruction Types", "Instruction Classes", and "Description of Operation". The column called "Instruction Types" would for instance for the CP instructions contain the CPTypes (there is also FEDTypes,SPType, etc.).
      When the constants class for the opcodes have been implemented, the first three columns can be generated automatically. The description column would probably have to be written manually.

      To summarize this task:
      1. Add an OpCode constants class.
      2. Generate a markdown table and write documentation for the opcodes.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebwrede Sebastian Wrede
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: