Commit 9d5491a
Templatize SIMDResultHandler on SL, mark handle() final (#5223)
Summary:
Pull Request resolved: #5223
Follow-up to D104552827 per Matthijs's review feedback. The non-template `SIMDResultHandler` base class had a virtual `handle()` using `simd16uint16_tpl<NONE>` in DD mode, while derived handlers used SL-specific types. This meant derived `handle()` methods HIDED rather than OVERRODE the base, preventing use of `override`/`final`.
This restructures the hierarchy: metadata fields from the old `SIMDResultHandler` are merged into `SIMDResultHandlerToFloat` (stays non-template for the polymorphic `FastScanCodeScanner::handler()` interface), and a new template `SIMDResultHandler<SL>` is inserted between them with a virtual `handle()` whose `simd16uint16` type matches the SL parameter. Concrete handlers now genuinely override this virtual and are marked `final`, signaling devirtualization/inlining intent.
Also removes dead code: `with_SIMDResultHandler()` (zero callers), `simd_result_handlers_accept_virtual` (only used by that function), and the file-scope `simd16uint16` alias (only used by the old base class).
Reviewed By: alibeklfc
Differential Revision: D105611944
fbshipit-source-id: 2faaed448692e38459a9c6253039cfa366512a7e1 parent b63f236 commit 9d5491a
5 files changed
Lines changed: 71 additions & 162 deletions
File tree
- faiss
- impl/fast_scan
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | 228 | | |
232 | 229 | | |
233 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | 137 | | |
139 | 138 | | |
140 | 139 | | |
| |||
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
191 | | - | |
| 190 | + | |
192 | 191 | | |
193 | 192 | | |
194 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | 356 | | |
360 | 357 | | |
361 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
| 85 | + | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| |||
0 commit comments