Skip to content

Commit 6fcd996

Browse files
committed
Add run CPU tests in CI
1 parent 1931ab5 commit 6fcd996

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

.github/workflows/cross-sve.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/gcc-aarch64-linux-gnu.cmake
4141
- name: Build
4242
run: cmake --build _build
43+
- name: Set CPU feature test expectations
44+
run: |
45+
echo "XSIMD_TEST_CPU_ASSUME_SSE4_2=0" >> "$GITHUB_ENV"
46+
echo "XSIMD_TEST_CPU_ASSUME_NEON64=1" >> "$GITHUB_ENV"
47+
echo "XSIMD_TEST_CPU_ASSUME_SVE=1" >> "$GITHUB_ENV"
4348
- name: Testing xsimd
4449
run: qemu-aarch64 --cpu max,sve${{ matrix.vector_bits }}=on -L /usr/aarch64-linux-gnu/ ./test/test_xsimd
4550
working-directory: ${{ github.workspace }}/_build

.github/workflows/linux.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
name: Linux build
1+
name: Linux x86 build
22
on: [push, pull_request]
33
concurrency:
44
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
55
cancel-in-progress: true
66
defaults:
77
run:
88
shell: bash -l {0}
9+
910
jobs:
1011
build:
1112
runs-on: ubuntu-latest
1213
name: '${{ matrix.sys.compiler }} ${{ matrix.sys.version }} - ${{ matrix.sys.flags }}'
1314
strategy:
1415
matrix:
1516
sys:
16-
- { compiler: 'gcc', version: '12', flags: 'force_no_instr_set' }
17-
- { compiler: 'gcc', version: '13', flags: 'enable_xtl_complex' }
18-
- { compiler: 'gcc', version: '14', flags: 'avx' }
17+
- { compiler: 'gcc', version: '12', flags: 'force_no_instr_set' }
18+
- { compiler: 'gcc', version: '13', flags: 'enable_xtl_complex' }
19+
- { compiler: 'gcc', version: '14', flags: 'avx' }
1920
- { compiler: 'gcc', version: '13', flags: 'avx512' }
2021
- { compiler: 'gcc', version: '10', flags: 'avx512' }
2122
- { compiler: 'gcc', version: '12', flags: 'i386' }
2223
- { compiler: 'gcc', version: '13', flags: 'avx512pf' }
2324
- { compiler: 'gcc', version: '13', flags: 'avx512vbmi' }
2425
- { compiler: 'gcc', version: '14', flags: 'avx512vbmi2' }
2526
- { compiler: 'gcc', version: '13', flags: 'avx512vnni' }
26-
- { compiler: 'clang', version: '16', flags: 'force_no_instr_set' }
27+
- { compiler: 'clang', version: '16', flags: 'force_no_instr_set' }
2728
- { compiler: 'clang', version: '16', flags: 'enable_xtl_complex' }
2829
- { compiler: 'clang', version: '17', flags: 'avx' }
2930
- { compiler: 'clang', version: '17', flags: 'sse3' }
@@ -119,9 +120,17 @@ jobs:
119120
run: cmake --build _build
120121
- name: Test
121122
run: |
123+
# Set CPU feature test expectations
124+
# Assuming the runner always has AVX (independent of compilation option)
125+
export XSIMD_TEST_CPU_ASSUME_NEON64="0"
126+
export XSIMD_TEST_CPU_ASSUME_SSE4_2="1"
127+
export XSIMD_TEST_CPU_ASSUME_AVX="1"
122128
cd _build/test
123129
if echo '${{ matrix.sys.flags }}' | grep -q 'avx512' ; then
130+
export XSIMD_TEST_CPU_ASSUME_AVX512F="1"
124131
../../sde-external-9.48.0-2024-11-25-lin/sde64 -tgl -- ./test_xsimd
125132
else
133+
# Explicitly assume the runner will not have avx512, which may change in the future
134+
export XSIMD_TEST_CPU_ASSUME_AVX512F="0"
126135
./test_xsimd
127136
fi

.github/workflows/macos.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on: [push, pull_request]
33
concurrency:
44
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
55
cancel-in-progress: true
6+
67
jobs:
78
build:
89
strategy:
@@ -21,5 +22,14 @@ jobs:
2122
run: cmake --build _build --verbose
2223
- name: Testing sequential
2324
run: cmake --build _build --target xbenchmark --verbose
25+
- name: Set CPU feature test expectations
26+
run: |
27+
if echo '${{ matrix.os }}' | grep -q intel; then
28+
echo "XSIMD_TEST_CPU_ASSUME_NEON64=0" >> "$GITHUB_ENV"
29+
echo "XSIMD_TEST_CPU_ASSUME_SSE4_2=1" >> "$GITHUB_ENV"
30+
else
31+
echo "XSIMD_TEST_CPU_ASSUME_NEON64=1" >> "$GITHUB_ENV"
32+
echo "XSIMD_TEST_CPU_ASSUME_SSE4_2=0" >> "$GITHUB_ENV"
33+
fi
2434
- name: Testing xsimd
2535
run: ${{github.workspace}}/_build/test/test_xsimd

.github/workflows/windows.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ on: [push, pull_request]
33
concurrency:
44
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
55
cancel-in-progress: true
6+
67
jobs:
7-
build:
8+
build-windows-x86:
89
name: 'MSVC ${{ matrix.os }}, ${{ matrix.target }} ${{ matrix.sys.set }}'
910
defaults:
1011
run:
@@ -48,6 +49,12 @@ jobs:
4849
run: cmake --build _build
4950
- name: Testing xsimd
5051
if: ${{ !startsWith(matrix.sys.set, 'AVX512') }}
52+
env:
53+
# Set CPU feature test expectations
54+
# Assuming the runner always has AVX2 (independent of compilation option)
55+
XSIMD_TEST_CPU_ASSUME_NEON64: "0"
56+
XSIMD_TEST_CPU_ASSUME_SSE4_2: "1"
57+
XSIMD_TEST_CPU_ASSUME_AVX2: "1"
5158
run: ./_build/test/test_xsimd
5259

5360
build-windows-mingw:
@@ -106,4 +113,8 @@ jobs:
106113
- name: Build
107114
run: cmake --build _build
108115
- name: Testing xsimd
116+
env:
117+
# Set CPU feature test expectations
118+
XSIMD_TEST_CPU_ASSUME_NEON64: "1"
119+
XSIMD_TEST_CPU_ASSUME_SSE4_2: "0"
109120
run: ./_build/test/test_xsimd

0 commit comments

Comments
 (0)