Can I use jdk.incubator.vector module alone

陈书明 1952132705 at qq.com
Wed Apr 22 01:28:41 UTC 2020


Hi,
    Thank you for your advice,it really help.

Sincerely,
Chenshuming


---Original---
From: "Paul Sandoz"<paul.sandoz at oracle.com>
Date: Wed, Apr 22, 2020 00:03 AM
To: "陈书明"<1952132705 at qq.com>;
Cc: "panama-dev"<panama-dev at openjdk.java.net>;
Subject: Re: Can I use jdk.incubator.vector module alone


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,
> &nbsp;&nbsp;&nbsp; I'm interesting in the jdk.incubator.vector module. I'm working on a deflator(the compress method of Zip) using vectorAPI.
> &nbsp;&nbsp;&nbsp; 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.
> 
> 
> &nbsp;&nbsp;&nbsp; So I tried these steps:
> &nbsp;&nbsp;&nbsp; 1. I find the jdk.incubator.vector.jmod file in Panama JDK files and extract it, so I get its class files.
> &nbsp;&nbsp;&nbsp; 2. I create a project in IDEA with openJDK14, and add these class files in step 1 to this project as exteral library.
> &nbsp;&nbsp;&nbsp; 3. I add some test code and run it,and it works.
> 
> 
> &nbsp;&nbsp;&nbsp; I really would like to know if it's OK to do like this. Maybe there are some better ways I can use&nbsp; to make vector API work on any other JDK instead of Panama?
> &nbsp;&nbsp;&nbsp; It's highly appreciated if you can give me some guide. Thanks!
> 
> 
> 
> Sincerely ,
> Chenshuming


More information about the panama-dev mailing list