facebookresearch / faiss

A library for efficient similarity search and clustering of dense vectors.
https://faiss.ai
MIT License
31.63k stars 3.65k forks source link

fix get_compile_options bug #3785

Closed mengdilin closed 3 months ago

mengdilin commented 3 months ago

Summary: Right now when avx512 is turned on, we will only return AVX2 in options. My understanding is turning on avx512 sets both the macros __AVX2__ and __AVX512F__: https://fburl.com/vgh7jg9p

Reviewed By: asadoughi

Differential Revision: D61674490

facebook-github-bot commented 3 months ago

This pull request was exported from Phabricator. Differential Revision: D61674490

alexanderguzhva commented 3 months ago

@mengdilin technically, according to the way this function is organized, this function is expected to return a single compilation option, not to list ones. The issue is valid, but the fix should be different

#ifdef __AVX512F__
    options += "AVX512 ";
#elif __AVX2__
    options += "AVX2 ";
#endif
facebook-github-bot commented 3 months ago

This pull request has been merged in facebookresearch/faiss@6053348b2e0d7997e2e29349bd05bd4d53f9d984.

mengdilin commented 3 months ago

@alexanderguzhva addressed by https://github.com/facebookresearch/faiss/pull/3798