Can I use jdk.incubator.vector module alone

Paul Sandoz paul.sandoz at oracle.com
Tue Apr 21 16:02:43 UTC 2020


Hi,

The Vector API requires enhancements to HotSpot and the java.base module to ensure operations get compiled to vector hardware instructions.  So it's not possible to cleanly separate the classes from the jdk.incubator.module and apply them externally on top of another JDK, they will not compile as is, and if you modify them to do so, they will not be optimized by the runtime compiler.

I do have a suggestion if you want to experiment.  Instead, checkout the Panama vectorIntrinsics branch, build the JDK, and then experiment with your zip deflator functionality using that JDK. 

Paul.

> On Apr 20, 2020, at 6:56 PM, 陈书明 <1952132705 at qq.com> wrote:
> 
> Dear Panama team,
>     I'm interesting in the jdk.incubator.vector module. I'm working on a deflator(the compress method of Zip) using vectorAPI.
>     Now I have a JDK which contain the jdk.incubator.vector module. What I want to know about is that if I can use this module alone instead of the entire Panama JDK for development ? As we all know, it's not easy to make users install the whole JDK.
> 
> 
>     So I tried these steps:
>     1. I find the jdk.incubator.vector.jmod file in Panama JDK files and extract it, so I get its class files.
>     2. I create a project in IDEA with openJDK14, and add these class files in step 1 to this project as exteral library.
>     3. I add some test code and run it,and it works.
> 
> 
>     I really would like to know if it's OK to do like this. Maybe there are some better ways I can use  to make vector API work on any other JDK instead of Panama?
>     It's highly appreciated if you can give me some guide. Thanks!
> 
> 
> 
> Sincerely ,
> Chenshuming



More information about the panama-dev mailing list