I know that when the o.a.l.util.VectorUtil gets loaded, there is some JUL
log messsages from the underlying VectorizationProvider to help inform
people running the application whether they are or are not getting the
Panama optimized vectorization support -- and if not why not.
What I'm wondering: is there is any downside to having some really simple
(public) introspection API that apps could call to report (using their own
loging or metrics reporting APIs) what implementation is in use?
Maybe something as simple as ...
VectorUtil:
public static boolean isImplNativeCodeOptimized() {
return IMPL.isNativeCodeOptimized();
}
public static String getImplDescription() {
return IMPL.getDescription();
}
VectorUtilSupport:
default boolean isNativeCodeOptimized() { return false; }
String getDescription();
DefaultVectorUtilSupport:
public String getDescription() { return "Default"; }
PanamaVectorUtilSupport:
public boolean isNativeCodeOptimized() { return true; }
public String getDescription() {
return String.format(
Locale.ENGLISH,
"Java vector incubator API enabled; uses preferredBitSize=%d%s%s",
PanamaVectorConstants.PREFERRED_VECTOR_BITSIZE,
Constants.HAS_FAST_VECTOR_FMA ? "; FMA enabled" : "",
VectorizationProvider.TESTS_VECTOR_SIZE.isPresent() ? "; testMode enabled" :
"")
}
PanamaVectorizationProvider:
// change logIncubatorSetup() ...
// call this.vectorUtilSupport.getDescription()
-Hoss
http://www.lucidworks.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]