-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow VectorUtilProvider tests to be executed although hardware may not fully support vectorization or if C2 is not enabled #12376
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ public class TestVectorUtilProviders extends LuceneTestCase { | |
|
||
private static final double DELTA = 1e-3; | ||
private static final VectorUtilProvider LUCENE_PROVIDER = new VectorUtilDefaultProvider(); | ||
private static final VectorUtilProvider JDK_PROVIDER = VectorUtil.PROVIDER; | ||
private static final VectorUtilProvider JDK_PROVIDER = VectorUtilProvider.lookup(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is great - that we can ensure that we're always testing the Panama implementation. I guess the test can sometime be slow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test only compares the default lucene provider with a few random vectors and compares results. So slowness does not matter here! Of course here we only test the Panama Implementation if it is Java 20/21 and it is not buggy (turkish locale bug). |
||
|
||
private static final int[] VECTOR_SIZES = { | ||
1, 4, 6, 8, 13, 16, 25, 32, 64, 100, 128, 207, 256, 300, 512, 702, 1024 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit of a pity that this check is now with a final rather than static final, but that's the price we pay for test-ability!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats ok, because in production we only have exactly one instance of this class, so it does not matter, it is optimized away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I like this more, because it is no negative test.