|
1 | | -name: Test on Older CPUs (x86_64-v2) |
2 | | - |
3 | | -# This workflow tests numpy-quaddtype on older x86 CPUs using Intel SDE. |
4 | | -# It ensures compatibility with x86_64-v2 baseline CPUs (e.g., Sandy Bridge) |
5 | | -# that don't have AVX2/FMA support. |
| 1 | +name: Test Older CPUs + Build Options |
6 | 2 |
|
7 | 3 | on: |
8 | 4 | push: |
|
13 | 9 |
|
14 | 10 | jobs: |
15 | 11 | test_old_cpu: |
16 | | - name: Test on ${{ matrix.cpu[1] }} |
| 12 | + name: Test ${{ matrix.config.name }} |
17 | 13 | runs-on: ubuntu-24.04 |
18 | 14 | strategy: |
19 | 15 | fail-fast: false |
20 | 16 | matrix: |
21 | | - cpu: |
22 | | - - ['snb', 'Sandy Bridge (x86_64-v2)'] |
23 | | - - ['hsw', 'Haswell (x86_64-v3)'] |
| 17 | + config: |
| 18 | + - name: "Sandy Bridge (x86_64-v2)" |
| 19 | + sde_cpu: "snb" |
| 20 | + meson_args: "-Csetup-args=-Ddisable_fma=true" |
| 21 | + - name: "Haswell (x86_64-v3)" |
| 22 | + sde_cpu: "hsw" |
| 23 | + meson_args: "" |
| 24 | + - name: "Haswell, no QBLAS" |
| 25 | + sde_cpu: "hsw" |
| 26 | + meson_args: "-Csetup-args=-Ddisable_quadblas=true" |
24 | 27 | steps: |
25 | 28 | - uses: actions/checkout@v6 |
26 | 29 | with: |
@@ -51,27 +54,21 @@ jobs: |
51 | 54 | env: |
52 | 55 | LDFLAGS: "-fopenmp" |
53 | 56 | run: | |
54 | | - # For Sandy Bridge (x86-64-v2), we need to disable FMA code paths |
55 | | - # since FMA instructions are not available on that microarchitecture |
56 | | - if [ "${{ matrix.cpu[0] }}" = "snb" ]; then |
57 | | - pip install .[test] --no-build-isolation -v -Csetup-args=-Ddisable_fma=true |
58 | | - else |
59 | | - pip install .[test] --no-build-isolation -v |
60 | | - fi |
| 57 | + pip install .[test] --no-build-isolation -v ${{ matrix.config.meson_args }} |
61 | 58 |
|
62 | | - - name: Test import on ${{ matrix.cpu[1] }} |
| 59 | + - name: Test import on ${{ matrix.config.name }} |
63 | 60 | run: | |
64 | | - echo "Testing basic import on ${{ matrix.cpu[1] }}..." |
65 | | - sde -${{ matrix.cpu[0] }} -- python -c " |
| 61 | + echo "Testing basic import on ${{ matrix.config.name }}..." |
| 62 | + sde -${{ matrix.config.sde_cpu }} -- python -c " |
66 | 63 | import numpy as np |
67 | 64 | print('NumPy version:', np.__version__) |
68 | 65 | from numpy_quaddtype import QuadPrecDType |
69 | 66 | print('QuadPrecDType imported successfully!') |
70 | 67 | arr = np.zeros(3, dtype=QuadPrecDType()) |
71 | 68 | print('Created quad array:', arr) |
72 | | - print('SUCCESS: Works on ${{ matrix.cpu[1] }}!') |
| 69 | + print('SUCCESS: Works on ${{ matrix.config.name }}!') |
73 | 70 | " |
74 | 71 |
|
75 | | - - name: Run tests on ${{ matrix.cpu[1] }} |
| 72 | + - name: Run tests on ${{ matrix.config.name }} |
76 | 73 | run: | |
77 | | - sde -${{ matrix.cpu[0] }} -- python -m pytest tests/ -v --tb=short -v -s |
| 74 | + sde -${{ matrix.config.sde_cpu }} -- python -m pytest tests/ -v --tb=short -v -s |
0 commit comments