Skip to content
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
18 changes: 18 additions & 0 deletions libs/simdvec/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

/**
* Contains Panama and native SIMD implementations of various vector operations.
* <p>
* The native code is contained in C++ files, with implementations for ARM and two generations of x86,
* using significant amounts of CPU intrinsics to utilise specific SIMD operations.
* The method handles are loaded using FFI, and made available through a series
* of wrapper classes to be called from Elasticsearch-defined vector formats.
* <p>
* Because the APIs used to perform SIMD operations from Java
* and call native code changes between JVM versions,
* there are different implementations of the wrapper classes for different JVM versions.
* This is handled using multi-release jars, with the JVM-specific implementations
* contained in the {@code mainXX} source sets.
* <p>
* As a result, some of the implementations in the {@code main} source set are not actually
* called at runtime, and only exist to be compiled against. The correct implementation to use
* at runtime is selected by the multi-release classloader.
*/
module org.elasticsearch.simdvec {
requires org.elasticsearch.nativeaccess;
requires org.apache.lucene.core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

final class VectorScorerFactoryImpl implements VectorScorerFactory {

/*
* This class is never actually used, it only exists here to be referenced at compile time.
* The actual implementation is loaded from main21 or main22, depending on JVM version,
* by the multi-release jar set up by the MrjarPlugin during build time.
*/

static final VectorScorerFactoryImpl INSTANCE = null;

@Override
Expand Down