-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Enable unit tests based on host CPU feature detection #131
Comments
Provided how complex is getting the code in CMake config files, I would go with using the CPU feature detection right on the test programs. It would be great if CMake / CTes would support the "ignored" flag. And definitely, the solution would not be limited to the SSE2 and AVX2 (I have plans to create an ARM/ NEON extension as well). |
After a bit of research, it looks like CMake allows the Unfortunately, it looks like there is an issue with the implementation of this feature affecting all versions of CMake up to and including the current version where skipping tests this way causes It does look like there are some alternative ways to implement this, so I'll keep looking for a workable solution. |
The AVX2 unit tests are still disabled (in
tests/CMakeLists.txt
). Ideally, I think we want to use the new CPU feature-detection logic in blosc along with CMake to determine which features the host CPU supports and enable the unit tests accordingly. E.g., if the host supports SSE2 and AVX2, both of those test suites will be enabled within the CMake script itself; if a host doesn't support AVX2 (for example), the tests wouldn't be enabled by CMake and therefore wouldn't even run.Alternatively, we could use the CPU feature detection within the test programs themselves to determine if the host CPU supports the features necessary for the test to run. In the case where it doesn't, we'd just return a success code (which is what the AVX2 tests are currently doing). Or, instead of returning a success code, it would be better if CMake / CTest supported returning an exit code indicating the test was "ignored" (many of the xUnit-style testing frameworks include this); I don't know whether CTest supports this, so some research would be required.
Any solution implemented for this should be designed under the assumption blosc will support additional CPU feature sets in the future (i.e., not limited to SSE2 and AVX2).
The text was updated successfully, but these errors were encountered: