Skip to content

Commit

Permalink
merge (#2777)
Browse files Browse the repository at this point in the history
* fix windows test (#2775)

Summary: Pull Request resolved: #2775

Reviewed By: algoriddle

Differential Revision: D44210010

fbshipit-source-id: b9b620a4b0a874e09ee2f6082ff0f9463716fdf4

* faiss/utils/simdlib_avx2.h: avoid C++20 ambiguous overloaded operator (#2772)

Summary:
Pull Request resolved: #2772

Resolves errors from overloaded ambiguous operators:
```
faiss/utils/partitioning.cpp:283:34: error: ISO C++20 considers use of overloaded operator '==' (with operand types 'faiss::simd16uint16' and 'faiss::simd16uint16') to be ambiguous despite there being a unique best viable function [-Werror,-Wambiguous-reversed-operator]
```

Reviewed By: alexanderguzhva, meyering

Differential Revision: D44186458

fbshipit-source-id: 0257fa0aaa4fe74c056bef751591f5f7e5357c9d

* Fix Debug Build on aarch64 (#2768)

Summary:
related: #1916, #1979, #2009, #2013, #2195, #2210

After my PR #1815 had been merged `-DCMAKE_BUILD_TYPE=Debug` has been invalid on aarch64, and many people have been hit the problem. (sorry to inconvenience...)
This PR fixes this.

### Details:

Using the function pointers of intrinsics on run-time context causes the link errors.
`-DCMAKE_BUILD_TYPE=Release` has been available because compiler optimizer can propagate and collapse the function pointers as constant.
However, when the pointers doesn't collapsed the link errors occurred, so `-DCMAKE_BUILD_TYPE=Debug` has been unavailable.
To prevent the link errors, I've replaced the function pointers of intrinsics on run-time context to on compile-time context explicitly.

Pull Request resolved: #2768

Reviewed By: mdouze

Differential Revision: D44296147

Pulled By: alexanderguzhva

fbshipit-source-id: 81fa013c5e05a486b6b82cb85d76eeefdefca891

---------

Co-authored-by: Matthijs Douze <[email protected]>
Co-authored-by: Jeff Palm <[email protected]>
Co-authored-by: Y.Imaizumi <[email protected]>
  • Loading branch information
4 people authored Mar 23, 2023
1 parent 9c30424 commit ac8ec07
Show file tree
Hide file tree
Showing 4 changed files with 240 additions and 159 deletions.
2 changes: 1 addition & 1 deletion contrib/ivf_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def write_checkpoint(self, fname, cur_list_no):
"rh": (self.rh.D, self.rh.I),
}, open(tmpname, "wb"), -1
)
os.rename(tmpname, fname)
os.replace(tmpname, fname)

def read_checkpoint(self, fname):
ckp = pickle.load(open(fname, "rb"))
Expand Down
4 changes: 2 additions & 2 deletions faiss/utils/simdlib_avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ struct simd16uint16 : simd256bit {
}

// returns binary masks
simd16uint16 operator==(simd256bit other) const {
return simd16uint16(_mm256_cmpeq_epi16(i, other.i));
friend simd16uint16 operator==(const simd256bit lhs, const simd256bit rhs) {
return simd16uint16(_mm256_cmpeq_epi16(lhs.i, rhs.i));
}

simd16uint16 operator~() const {
Expand Down
Loading

0 comments on commit ac8ec07

Please sign in to comment.