Open
Conversation
Contributor
AntoinePrv
commented
Apr 3, 2026
- Add cpu_feature test
- Add run CPU tests in CI
| - name: Test | ||
| run: | | ||
| # Set CPU feature test expectations | ||
| # Assuming the runner always has AVX (independent of compilation option) |
Contributor
There was a problem hiding this comment.
you can theoritically check that through grep -E '\<avx\>' /proc/cpuinfo
| run: cmake --build _build | ||
| - name: Set CPU feature test expectations | ||
| run: | | ||
| echo "XSIMD_TEST_CPU_ASSUME_SSE4_2=0" >> "$GITHUB_ENV" |
Contributor
There was a problem hiding this comment.
wouldn't that be easy to just not set it instead of setting it to zero?
|
|
||
| #include "xsimd/xsimd.hpp" | ||
|
|
||
| #define CHECK_IMPLICATION(a, b) CHECK_UNARY(!(a) || (b)) |
Contributor
There was a problem hiding this comment.
wow that reminds me of my old logic lessons ^^!
| xsimd::x86_cpu_features cpu; | ||
|
|
||
| // SSE implication chain | ||
| CHECK_IMPLICATION(cpu.sse4_2(), cpu.sse4_1()); |
Contributor
There was a problem hiding this comment.
Would that make sense to use this to also check the is_base_of type relationship?
| void check_env_flag(const char* env_var, const char* feature_name, bool actual) | ||
| { | ||
| const char* val = std::getenv(env_var); | ||
| if (val) |
Contributor
There was a problem hiding this comment.
nit: if (const char* val = ...)
| const char* val = std::getenv(env_var); | ||
| if (val) | ||
| { | ||
| // Doctest struggles with string litteras and const char * |
Contributor
There was a problem hiding this comment.
TODO(c++20): use std::format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.