Test all supported vector widths#25
Conversation
|
Thank you for the PR! I see one problem with the current approach. If someone has a machine that doesn't support 512-bit vectors, they cannot test the implementation for this width. Java provides scalar replacements when hardware support for a specific width is missing. Therefore, it should be possible to test 512-bit vectors on 256-bit-capable machines. I did a brief research, but I couldn't find any JVM flag that would override What are your thoughts on this? |
|
Thank you for the comments. What you suggested is better. I updated the static initializer in StructuralIndexer.java to use a system property. Now the tests are run unconditionally with both vector widths. I tested this on my 512-bit-enabled platform. At the moment I don't have access to a 256-only platform so, to trigger the scalar use case, I temporarily combined -XX:UseAvx=2 and -Dorg.simdjson.species=512. The tests took about twice as long to run but ran successfully. |
|
It looks good to me. Thank you again. |
* test both vector species if on 512-bit-capable platform * test both species on all platforms
Addresses issue #23: Test all supported vector widths.
Changes build.gradle and adds a gradle.properties file. Now tests with both 256-bit and 512-bit vectors on 512-bit-capable platforms. Tests only with 256-bit vectors on 256-bit-capable platforms.