VectorPerformance icon indicating copy to clipboard operation
VectorPerformance copied to clipboard

Build failed package jdk.incubator.vector is not visible

Open LifeIsStrange opened this issue 4 years ago • 7 comments

java: package jdk.incubator.vector is not visible
  (package jdk.incubator.vector is declared in module jdk.incubator.vector, which is not in the module graph)
/home/stephane/dev/VectorPerformance/src/main/java/benchmark/MatrixMultiplication.java:4:21
java: package jdk.incubator.vector is not visible
  (package jdk.incubator.vector is declared in module jdk.incubator.vector, which is not in the module graph) 

I am on intellij Idea 2021.1 beta (latest EAP) and use the openjdk 16 provided by intellij. What should I do ? @lessthanoptimal

LifeIsStrange avatar Mar 22 '21 22:03 LifeIsStrange

Recommendation: Use the command line to run the code and IntelliJ to edit it.

IntelliJ is still catching up with all the recent changes to Gradle and maybe the JDK too. I've created one issue here: https://youtrack.jetbrains.com/issue/IDEA-264713

I'm crossing my fingers that the next update to IntelliJ will fix these problems.

lessthanoptimal avatar Mar 22 '21 23:03 lessthanoptimal

Thanks for the advice. I'm on archlinux which is still on openjdk 15... I'll try with SDKman

LifeIsStrange avatar Mar 23 '21 00:03 LifeIsStrange

I'm on archlinux which is still on openjdk 15... I'll try with SDKman

Try yay java-openjdk-ea-bin if your happy with the Arch User Repository. That will give give you the current early access version of Java 17.

HullBend avatar Mar 23 '21 18:03 HullBend

While I'm with you guys I have another (off-topic) question, feel free to not answer ! So I'm a noob at SIMD and I struggle to understand the difference between Sse2.Add(sum, sum); -> __m128d _mm_add_pd (__m128d a, __m128d b) and Sse3.HorizontalAdd(sum, sum); -> __m128d _mm_hadd_pd (__m128d a, __m128d b) It's from the C# API Their documentation is inexistant and only redirect to the x86 intrinsics.

The equivalent of Sse2.Add should be https://download.java.net/java/early_access/jdk16/docs/api/jdk.incubator.vector/jdk/incubator/vector/DoubleVector.html#add(jdk.incubator.vector.Vector) However what is an horizontal Add and how to reproduce an horizontal add with the jdk vector API ?

Intel says :

Horizontally add adjacent pairs of double-precision (64-bit) floating-point elements in a and b, and pack the results in dst.

Whats the difference with "Adds this vector to a second input vector. This is a lane-wise binary operation which applies the primitive addition operation (+) to each pair of corresponding lane values." ?

LifeIsStrange avatar Mar 23 '21 19:03 LifeIsStrange

I have the same problem, and solved.

In my view, when build, idea uses package is not visible, and you have to set compile args: <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> 17 17 <compilerArgs combine.children="append"> --add-exports=java.base/sun.net.util=ALL-UNNAMED --add-exports=java.management/sun.management=ALL-UNNAMED --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-modules=jdk.incubator.vector </compilerArgs>

jiangjiguang avatar Jul 06 '22 07:07 jiangjiguang

image

jiangjiguang avatar Jul 06 '22 07:07 jiangjiguang

Cool, thanks. In my case, I add options to both pom.xml and Idea run configuration (modify options -- add VM options), make Idea mvn reload, and run code from Idea.

The main surprise is that vector computation was much (20x) slow in my case )

I take example from https://openjdk.org/jeps/426, and replace float to double, array size was 10k and 100k

Mikhail42 avatar Aug 11 '22 21:08 Mikhail42