Skip to content

Commit

Permalink
Small fixes for compilation on ARM (#1655)
Browse files Browse the repository at this point in the history
Summary:
This PR fixes a few small issues with compilation on ARM.
It has been tested on an AWS c6g.8xlarge machine with Ubuntu 18.04.5 LTS.
Compilation instructions are here: https://github.com/facebookresearch/faiss/wiki/Installing-Faiss#compiling-faiss-on-arm

Pull Request resolved: #1655

Reviewed By: wickedfoo

Differential Revision: D26145921

Pulled By: mdouze

fbshipit-source-id: 007e57a610f489885e78ba22bc82605d67661c44
  • Loading branch information
mdouze authored and facebook-github-bot committed Jan 29, 2021
1 parent 7c2d238 commit 27077c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions faiss/utils/distances_simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,11 @@ float fvec_Linf (const float * x, const float * y, size_t d)
return fvec_Linf_ref (x, y, d);
}

void fvec_inner_products_ny (float * dis, const float * x,
const float * y, size_t d, size_t ny) {
fvec_inner_products_ny_ref (dis, x, y, d, ny);
}


#else
// scalar implementation
Expand Down
7 changes: 5 additions & 2 deletions tests/test_meta_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ def do_test_remove(self, index_type):
id_list = gen.permutation(nb * 7)[:nb].astype('int64')
index.add_with_ids(xb, id_list)


print('ref search ntotal=%d' % index.ntotal)
Dref, Iref = index.search(xq, k)

Expand Down Expand Up @@ -242,13 +241,17 @@ def do_test_remove(self, index_type):
D, I = index.search(xq, k)

# make sure results are in the same order with even ones removed
ndiff = 0
for i in range(nq):
j2 = 0
for j in range(k):
if Iref[i, j] % 2 != 0:
assert I[i, j2] == Iref[i, j]
if I[i, j2] != Iref[i, j]:
ndiff += 1
assert abs(D[i, j2] - Dref[i, j]) < 1e-5
j2 += 1
# draws are ordered arbitrarily
assert ndiff < 5

def test_remove(self):
self.do_test_remove(1)
Expand Down

0 comments on commit 27077c4

Please sign in to comment.