Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement VectorUtilProvider with Java 21 Project Panama Vector API #12363

Merged
merged 6 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/generation/extract-jdk-apis.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
6 changes: 3 additions & 3 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
ChrisHegarty marked this conversation as resolved.
Show resolved Hide resolved
(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -98,9 +98,9 @@ static VectorUtilProvider lookup() {
} 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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.