[Vector] RFR: reshape, resize, rebracket, cast

Viswanathan, Sandhya sandhya.viswanathan at intel.com
Wed Jan 30 01:30:30 UTC 2019


Hi All,

Please find the updated webrev for reinterpret, reshape and cast at:
http://cr.openjdk.java.net/~sviswanathan/vectorIntrinsics/ReinterpretReshapeCast/webrev.02/

This update implements the two review inputs from Vladimir:
1) 
Update users:
test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/AbstractVectorBenchmark.java
test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/PopulationCount.java
test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/SumOfUnsignedBytes.java
test/jdk/jdk/incubator/vector/VectorHash.java
test/jdk/jdk/incubator/vector/VectorReshapeTests.java
test/jdk/jdk/incubator/vector/CovarOverrideTest.java

2)
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java:
+    public <F> Vector<F> defaultReinterpret(Species<F> s) {
+        public abstract Class<?> vectorType();
Those operations shouldn't be part of public API.

Please let me know if this looks ok to push.

Best Regards,
Sandhya

-----Original Message-----
From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Brian Goetz
Sent: Monday, January 28, 2019 3:38 PM
To: Kharbas, Kishor <kishor.kharbas at intel.com>; panama-dev at openjdk.java.net
Subject: Re: [Vector] RFR: reshape, resize, rebracket, cast

The issue you raise is a minor frustration, but overall I think the 
direction of movement -- from species to vector -- is the right one.  We 
can work on ironing out these small issues later.

On 1/16/2019 3:20 AM, Kharbas, Kishor wrote:
>
> Hi,
>
> I have a patch which refactors the above methods as discussed in this 
> thread - 
> https://mail.openjdk.java.net/pipermail/panama-dev/2018-December/003365.html.
>
> Please review the changes at - 
> http://cr.openjdk.java.net/~kkharbas/vector-api/webrev-reshape_etc
>
> Generation of intrinsics and correct vector boxing elimination have 
> been verified. In the next patch I will add changes to jtreg tests.
>
> I wanted to bring forth one small issue(possibly) which programmers 
> might face with this change -
>
> We provide specialized types like IntVector, FloatVector, etc for 
> users to define their vectors and they would be able to write code 
> like this with previous methods,
>
> /FloatVector float256 = SPECIES_FLOAT256.cast(int256);/
>
> Here FloatSpecies would always return FloatVector.
>
> However with this change, since cast() is defined on a vector and 
> takes species of a generic type, it cannot return a specialized Vector 
> like IntVector or FloatVector. User has to explicitly cast the return 
> vector from Vector<T> to specialized Vector or use a generic vector of 
> corresponding element type. For example,
>
> /    FloatVector float256 = (FloatVector)int256.cast(SPECIES_FLOAT256);/
>
> /  or/
>
> /    Vector<Float> float256 = int256.cast(SPECIES_FLOAT256);/
>
> I am not sure if this is even a problem, but I thought its worth 
> mentioning.
>
> Thanks
>
> Kishor
>



More information about the panama-dev mailing list