Commit fbf3dd7
peng.li24
ci: detect AVX-512 usability at cmake time; fix DISPATCH ifdef guards
Root cause: Azure CI VMs expose avx512f in CPUID but the hypervisor
traps ZMM instruction execution. -mavx512f makes GCC compile AVX-512
code (including avx512_loops.h template specializations without runtime
guards) → SIGILL at test startup.
Fix 1 — CMakeLists.txt: use check_cxx_source_runs to probe whether a
ZMM instruction actually executes. Only adds -mavx512f/-mprefer-vector-
width=256 when the probe succeeds. On Azure CI runners the probe gets
SIGILL (exit 132) → NUMPYCPP_AVX512_WORKS=FALSE → no -mavx512f →
no SIGILL. On real AVX-512 hardware the probe succeeds → SVML + wide
AVX-512 loop paths are enabled as before.
Fix 2 — svml_bridge.h: wrap all DISPATCH_F64/F32 macro bodies and
call sites in #ifdef __AVX512F__ so the dispatchers compile cleanly
when -mavx512f is absent. Without -mavx512f: always scalar npy_* path
(still bit-exact — numpy uses the same scalar path on non-AVX-512).1 parent fde9e28 commit fbf3dd7
2 files changed
Lines changed: 55 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
265 | 270 | | |
266 | 271 | | |
| 272 | + | |
267 | 273 | | |
268 | 274 | | |
269 | | - | |
270 | | - | |
271 | | - | |
| 275 | + | |
272 | 276 | | |
273 | 277 | | |
274 | | - | |
275 | 278 | | |
276 | 279 | | |
277 | | - | |
278 | | - | |
279 | | - | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
| 295 | + | |
288 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
289 | 300 | | |
290 | 301 | | |
291 | 302 | | |
| |||
326 | 337 | | |
327 | 338 | | |
328 | 339 | | |
| 340 | + | |
329 | 341 | | |
| 342 | + | |
330 | 343 | | |
331 | 344 | | |
332 | 345 | | |
| 346 | + | |
333 | 347 | | |
| 348 | + | |
334 | 349 | | |
335 | 350 | | |
336 | 351 | | |
| 352 | + | |
337 | 353 | | |
| 354 | + | |
338 | 355 | | |
339 | 356 | | |
340 | 357 | | |
| 358 | + | |
341 | 359 | | |
| 360 | + | |
342 | 361 | | |
343 | 362 | | |
344 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
56 | 73 | | |
57 | 74 | | |
58 | 75 | | |
| |||
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 89 | + | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
| |||
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
86 | 108 | | |
87 | 109 | | |
88 | 110 | | |
| |||
0 commit comments