Commit 7531d62
committed
fix: static SIMD dispatch falls to scalar for avx512_spr/avx512/arm_sve builds
The static (non-DD) dispatch path in with_selected_simd_levels performs a
single exact-match check against SINGLE_SIMD_LEVEL. When the compiled
level is not in the available-levels mask, it falls directly to NONE
(scalar) instead of trying lower SIMD levels.
No predefined mask includes AVX512_SPR, and no AVX512_SPR template
specializations exist, so static avx512_spr builds dispatch every
SIMD-accelerated function to scalar. Static avx512 builds also regress
to scalar for 256-bit operations (AVX2_NEON mask), and static arm_sve
builds lose ARM_NEON fallback.
Add a compile-time fallthrough chain mirroring the DD switch/fallthrough:
x86: AVX512_SPR -> AVX512 -> AVX2 -> NONE
ARM: ARM_SVE -> ARM_NEON -> NONE
Fixes 9 broken (level x mask) combinations across distances, RaBitQ,
scalar/product quantizer, HNSW, IndexFlat, IVF, and fused distances.
Signed-off-by: Mulugeta Mammo <mulugeta.mammo@intel.com>1 parent 364749e commit 7531d62
1 file changed
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
112 | 116 | | |
| 117 | + | |
113 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
114 | 135 | | |
115 | 136 | | |
116 | 137 | | |
| |||
0 commit comments