uschindler commented on code in PR #12410: URL: https://github.com/apache/lucene/pull/12410#discussion_r1250504901
########## lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java: ########## @@ -15,79 +15,97 @@ * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.internal.vectorization; import java.lang.Runtime.Version; +import java.lang.StackWalker.StackFrame; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Locale; import java.util.Objects; import java.util.logging.Logger; +import java.util.stream.Stream; +import org.apache.lucene.util.SuppressForbidden; +import org.apache.lucene.util.VectorUtil; + +/** + * A provider of vectorization implementations. Depending on the Java version and availability of + * vectorization modules in the Java runtime this class provides optimized implementations (using + * SIMD) of several algorithms used throughout Apache Lucene. + * + * @lucene.internal + */ +public abstract class VectorizationProvider { Review Comment: One addition: By returning null or similar for the provider we miss some flexibility: Based on Panama's options we can opt in / opt out to implement some methods. With the current approach we can fall back to the default implementation only for some interface or only for one method, if Panama does not have a specific feature enabled (or not in that version). The current VectorUtilSupport for integer vectors already opts out if AVX2 is not available. Currently it is an if statment, but it could also call `DefaultVectorUtilSupport#dotProduct()` if we have no AVX2. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org