2 years ago
#51129
stgatilov
Conditional import of Java Vector API
I am playing around with Vector API in JDK 17.
Since it is not available on older version of Java, I wonder if it is possible to conditionally import it. So that if Vector API is available, then Java compiler imports it and runs one code path (the fast one), and if it is not available (e.g. Java 8), then compiler/runtime does not import the module and uses the second code path (the simple one).
And if that's impossible, then how are early adopters supposed to use the feature in any real code without bumping requirement on Java version? Or does "incubator API" means that it should never go beyond toy projects and benchmarks?
java
simd
conditional-compilation
0 Answers
Your Answer