Commit e4ef2eff authored by Matthijs Douze's avatar Matthijs Douze

make bench work with 1 GPU

parent 15ebfcd4
......@@ -552,7 +552,10 @@ def compute_populated_index(preproc):
t0 = time.time()
for i in range(ngpu):
index_src = faiss.index_gpu_to_cpu(gpu_index.at(i))
if ngpu == 1:
index_src = faiss.index_gpu_to_cpu(gpu_index)
else:
index_src = faiss.index_gpu_to_cpu(gpu_index.at(i))
print " index %d size %d" % (i, index_src.ntotal)
index_src.copy_subset_to(indexall, 0, 0, nb)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment