Implement VectorUtilProvider with Java 21 Project Pamana Vector API (#12363)

This commit enables the Panama Vector API for Java 21. The version of
VectorUtilPanamaProvider for Java 21 is identical to that of Java 20.
As such, there is no specific 21 version - the Java 20 version will be
loaded from the MRJAR.
This commit is contained in:
Chris Hegarty 2023-06-13 09:44:58 +01:00 committed by GitHub
parent 071461ece5
commit 1090928c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -20,7 +20,7 @@ def resources = scriptResources(buildscript)
configure(rootProject) {
ext {
// also change this in extractor tool: ExtractForeignAPI
vectorIncubatorJavaVersions = [ JavaVersion.VERSION_20 ] as Set
vectorIncubatorJavaVersions = [ JavaVersion.VERSION_20, JavaVersion.VERSION_21 ] as Set
}
}

View File

@ -138,9 +138,9 @@ New Features
* GITHUB#12257: Create OnHeapHnswGraphSearcher to let OnHeapHnswGraph to be searched in a thread-safety manner. (Patrick Zhai)
* GITHUB#12302, GITHUB#12311: Add vectorized implementations of VectorUtil.dotProduct(),
squareDistance(), cosine() with Java 20 jdk.incubator.vector APIs. Applications started
with command line parameter "java --add-modules jdk.incubator.vector" on exactly Java 20
* GITHUB#12302, GITHUB#12311, GITHUB#12363: Add vectorized implementations of VectorUtil.dotProduct(),
squareDistance(), cosine() with Java 20 or 21 jdk.incubator.vector APIs. Applications started
with command line parameter "java --add-modules jdk.incubator.vector" on exactly Java 20 or 21
will automatically use the new vectorized implementations if running on a supported platform
(x86 AVX2 or later, ARM NEON). This is an opt-in feature and requires explicit Java
command line flag! When enabled, Lucene logs a notice using java.util.logging. Please test

View File

@ -56,7 +56,7 @@ interface VectorUtilProvider {
static VectorUtilProvider lookup() {
final int runtimeVersion = Runtime.version().feature();
if (runtimeVersion == 20) {
if (runtimeVersion >= 20 && runtimeVersion <= 21) {
// is locale sane (only buggy in Java 20)
if (isAffectedByJDK8301190()) {
LOG.warning(
@ -98,9 +98,9 @@ interface VectorUtilProvider {
} catch (ClassNotFoundException cnfe) {
throw new LinkageError("VectorUtilPanamaProvider is missing in Lucene JAR file", cnfe);
}
} else if (runtimeVersion >= 21) {
} else if (runtimeVersion >= 22) {
LOG.warning(
"You are running with Java 21 or later. To make full use of the Vector API, please update Apache Lucene.");
"You are running with Java 22 or later. To make full use of the Vector API, please update Apache Lucene.");
}
return new VectorUtilDefaultProvider();
}

View File

@ -0,0 +1,2 @@
The version of VectorUtilPanamaProvider for Java 21 is identical to that of Java 20.
As such, there is no specific 21 version - the Java 20 version will be loaded from the MRJAR.