Array addition and array sum Panama benchmarks

Antoine Chambille ach at activeviam.com
Fri Mar 22 13:38:10 UTC 2024


That's right! Sorry, thank you for spotting this, I have updated the
benchmarks.

-Antoine

On Fri, Mar 22, 2024 at 11:10 AM Roland Westrelin <rwestrel at redhat.com>
wrote:

>
> >  .vectorArrayArray             7252565.080 ops/s
> >  .vectorArraySegment           6938948.826 ops/s
> >  .vectorSegmentArray           4953042.042 ops/s
> >  .vectorSegmentSegment         4606278.152 ops/s
>
> I think some of the vector API tests are buggy. Shouldn't
> vectorArraySegment be something like:
>
>     public void vectorArraySegment(Data state) {
>         final double[] input = state.inputArray;
>         final MemorySegment output = state.outputSegment;
>
>         for (int i = 0; i < input.length; i+=SPECIES.length()) {
>             DoubleVector a = DoubleVector.fromArray(SPECIES, input, i);
>             long offset = ((long)i) * (SPECIES.vectorByteSize() /
> SPECIES.length());
>             DoubleVector b = DoubleVector.fromMemorySegment(SPECIES,
> output, offset, ByteOrder.nativeOrder());
>             a = a.add(b);
>             a.intoMemorySegment(output, offset, ByteOrder.nativeOrder());
>         }
>     }
>
> because intoMemorySegment() and fromMemorySegment() take an offset and
> not an index as input?
>
> With that fixed (assuming I got this right), all vector API tests
> perform about the same.
>
> Roland.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240322/c22b04fc/attachment.htm>


More information about the panama-dev mailing list