Skip to content

Commit f276c47

Browse files
Alexandr Guzhvafacebook-github-bot
Alexandr Guzhva
authored andcommitted
Minor speedup of HNSW (facebookresearch#2832)
Summary: Pull Request resolved: facebookresearch#2832 Switch to `omp schedule(guided)` in HNSW::search() call Reviewed By: mdouze Differential Revision: D45360510 fbshipit-source-id: 5230429748c0e1e12d8fc2ea7184e273dee76bdf
1 parent 29318b3 commit f276c47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

faiss/IndexHNSW.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void IndexHNSW::search(
312312
DistanceComputer* dis = storage_distance_computer(storage);
313313
ScopeDeleter1<DistanceComputer> del(dis);
314314

315-
#pragma omp for reduction(+ : n1, n2, n3, ndis, nreorder)
315+
#pragma omp for reduction(+ : n1, n2, n3, ndis, nreorder) schedule(guided)
316316
for (idx_t i = i0; i < i1; i++) {
317317
idx_t* idxi = labels + i * k;
318318
float* simi = distances + i * k;

0 commit comments

Comments
 (0)