Skip to content

Commit 3d0ac32

Browse files
Michelle Mafacebook-github-bot
Michelle Ma
authored andcommitted
Expose accumulate_to_mem from faiss interface (facebookresearch#4099)
Summary: Pull Request resolved: facebookresearch#4099 Expose interface of accumulate_to_mem. accumulate_to_mem calls pq4 fast scan accumulate with a dummy scaler and a StoreResultHandler. The function is not currently in use anywhere. We plan to use it in unicorn integration of PQ4 fast scan. Reviewed By: asadoughi Differential Revision: D67299378 fbshipit-source-id: d6b1b247c4f14b698058cb671dd418bf32d35ca0
1 parent 162e6ce commit 3d0ac32

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

faiss/impl/pq4_fast_scan.h

+18
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,22 @@ void pq4_accumulate_loop_qbs(
189189
SIMDResultHandler& res,
190190
const NormTableScaler* scaler = nullptr);
191191

192+
/** Wrapper of pq4_accumulate_loop_qbs using simple StoreResultHandler
193+
* and DummyScaler
194+
*
195+
* @param nq number of queries
196+
* @param ntotal2 number of database elements (multiple of 32)
197+
* @param nsq number of sub-quantizers (muliple of 2)
198+
* @param codes packed codes array
199+
* @param LUT packed look-up table
200+
* @param accu array to store the results
201+
*/
202+
void accumulate_to_mem(
203+
int nq,
204+
size_t ntotal2,
205+
int nsq,
206+
const uint8_t* codes,
207+
const uint8_t* LUT,
208+
uint16_t* accu);
209+
192210
} // namespace faiss

0 commit comments

Comments
 (0)