12
12
13
13
#include < faiss/impl/FaissAssert.h>
14
14
#include < faiss/impl/platform_macros.h>
15
+ #include < faiss/impl/pq_4bit/LookupTableScaler.h>
15
16
#include < faiss/impl/pq_4bit/pq4_fast_scan.h>
16
17
#include < faiss/impl/pq_4bit/simd_result_handlers.h>
17
18
18
- #include < faiss/impl/pq_4bit/kernels_simd256 .h>
19
+ #include < faiss/impl/pq_4bit/kernels_common .h>
19
20
20
21
namespace faiss {
22
+ using namespace simd_result_handlers ;
21
23
22
24
/* * Mix-in class that manages both an SIMD result hander and offers the actual
23
25
* scanning routines. */
@@ -69,14 +71,18 @@ PQ4CodeScanner* make_handler_2(
69
71
const IDSelector* sel) {
70
72
if (k == 1 ) {
71
73
return new ScannerMixIn<
72
- SingleResultHandler<C, with_id_map, SL>,
74
+ faiss::simd_result_handlers::
75
+ SingleResultHandler<C, with_id_map, SL>,
73
76
Scaler>(norm_scale, nq, ntotal, dis, ids, sel);
74
77
} else if (use_reservoir) {
75
- return new ScannerMixIn<ReservoirHandler<C, with_id_map, SL>, Scaler>(
76
- norm_scale, nq, ntotal, k, 2 * k, dis, ids, sel);
78
+ return new ScannerMixIn<
79
+ faiss::simd_result_handlers::
80
+ ReservoirHandler<C, with_id_map, SL>,
81
+ Scaler>(norm_scale, nq, ntotal, k, 2 * k, dis, ids, sel);
77
82
} else {
78
- return new ScannerMixIn<HeapHandler<C, with_id_map, SL>, Scaler>(
79
- norm_scale, nq, ntotal, k, dis, ids, sel);
83
+ return new ScannerMixIn<
84
+ faiss::simd_result_handlers::HeapHandler<C, with_id_map, SL>,
85
+ Scaler>(norm_scale, nq, ntotal, k, dis, ids, sel);
80
86
}
81
87
}
82
88
@@ -87,8 +93,9 @@ PQ4CodeScanner* make_handler_2(
87
93
float radius,
88
94
size_t ntotal,
89
95
const IDSelector* sel) {
90
- return new ScannerMixIn<RangeHandler<C, with_id_map, SL>, Scaler>(
91
- norm_scale, rres, radius, ntotal, sel);
96
+ return new ScannerMixIn<
97
+ faiss::simd_result_handlers::RangeHandler<C, with_id_map, SL>,
98
+ Scaler>(norm_scale, rres, radius, ntotal, sel);
92
99
}
93
100
94
101
template <SIMDLevel SL, bool with_id_map, class C , class Scaler >
@@ -100,8 +107,10 @@ PQ4CodeScanner* make_handler_2(
100
107
size_t q0,
101
108
size_t q1,
102
109
const IDSelector* sel) {
103
- return new ScannerMixIn<PartialRangeHandler<C, with_id_map, SL>, Scaler>(
104
- norm_scale, pres, radius, ntotal, q0, q1, sel);
110
+ return new ScannerMixIn<
111
+ faiss::simd_result_handlers::
112
+ PartialRangeHandler<C, with_id_map, SL>,
113
+ Scaler>(norm_scale, pres, radius, ntotal, q0, q1, sel);
105
114
}
106
115
107
116
// this function dispatches runtime -> template parameters. It is generic for
0 commit comments