Skip to content

Commit e02b9b8

Browse files
committed
Java changes + logs
1 parent a8f94fe commit e02b9b8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

libs/native/src/main/java/org/elasticsearch/nativeaccess/jdk/JdkVectorLibrary.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public final class JdkVectorLibrary implements VectorLibrary {
4141
try {
4242
int caps = (int) vecCaps$mh.invokeExact();
4343
logger.info("vec_caps=" + caps);
44-
if (caps != 0) {
44+
if (caps > 0) {
4545
if (caps == 2) {
4646
dot7u$mh = downcallHandle(
4747
"dot7u_2",
@@ -67,6 +67,12 @@ public final class JdkVectorLibrary implements VectorLibrary {
6767
}
6868
INSTANCE = new JdkVectorSimilarityFunctions();
6969
} else {
70+
if (caps < 0) {
71+
logger.warn("""
72+
Your CPU supports vector capabilities, but they are disabled at OS level. For optimal performance, enable them in \
73+
your OS/Hypervisor/VM/container
74+
""");
75+
}
7076
dot7u$mh = null;
7177
sqr7u$mh = null;
7278
INSTANCE = null;

libs/simdvec/native/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ apply plugin: 'cpp'
1111

1212
var os = org.gradle.internal.os.OperatingSystem.current()
1313

14-
// To update this library run publish_vec_binaries.sh ( or ./gradlew vecSharedLibrary )
14+
// To update this library run publish_vec_binaries.sh ( or ./gradlew buildSharedLibrary )
1515
// Or
1616
// For local development, build the docker image with:
1717
// docker build --platform linux/arm64 --progress=plain --file=Dockerfile.aarch64 . (for aarch64)

0 commit comments

Comments
 (0)