Details

    • Type: Sub-task
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      Linear access to arrays and byte buffers is optimally supported. Strided access or data dependent access, where data is gathered from or scatter to memory is not optimally supported and requires further investigation.

      Examples are

      - access to image data encoded linearly in RGBZ form where the colour components would be gathered into vectors to be operated on; or
       
      - more generally access to arrays of structures.

      Such access is currently supported with a method providing an additional index map, such as on the Species on IntVector:

              /**
               * Loads a vector from an array using indexes obtained from an index
               * map.
               * <p>
               * For each vector lane, where {@code N} is the vector lane index, the
               * array element at index {@code i + indexMap[j + N]} is placed into the
               * resulting vector at lane index {@code N}.
              ...
              public IntVector<S> fromArray(int[] a, int i, int[] indexMap, int j)

      and on IntVector:

          /**
           * Stores this vector into an array using indexes obtained from an index
           * map.
           * <p>
           * For each vector lane, where {@code N} is the vector lane index, the
           * lane element at index {@code N} is stored into the array at index
           * {@code i + indexMap[j + N]}.
          ...
          public void intoArray(int[] a, int i, int[] indexMap, int j) {

      Since Shuffle only holds indexes in the range of [0, L) where L is the Vector length it is not a suitable representation. A ByteVector might be that holds constant patterns. However, for cases of uniform data occurring at regular intervals it may be easier to specify the stride directly. We may be missing an abstraction to declare, in general, an addressing mode that is translatable by the runtime compiler into efficient loads and stored when common patterns are detected.

      Certain forms of access could be supported by loading from memory directly into byte vectors then operating on data within the vectors rebracketing and compressing with masks as needed.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              psandoz Paul Sandoz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: