Skip to content

Fix test_cppcontrib_sa_decode.cpp #2388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

wx257osn2
Copy link
Contributor

@wx257osn2 wx257osn2 commented Jul 19, 2022

This PR contains below changes:

  • Conform C++11
  • Enable AVX2 on faiss_test
    • Currently faiss_test is compiled without -mavx2 even if -DFAISS_OPT_LEVEL=avx2 , so tests/test_cppcontrib_sa_decode.cpp hasn't checked faiss/cppcontrib/SaDecodeKernels-avx2-inl.h at all . This PR adds -mavx2 to faiss_test if -DFAISS_OPT_LEVEL=avx2 , so now tests/test_cppcontrib_sa_decode.cpp confirms faiss/cppcontrib/SaDecodeKernels-avx2-inl.h if -DFAISS_OPT_LEVEL=avx2 , and does faiss/cppcontrib/SaDecodeKernels-inl.h if not -DFAISS_OPT_LEVEL=avx2 .

@wx257osn2 wx257osn2 changed the title Fix test_contrib_sa_decode.cpp Fix test_cppcontrib_sa_decode.cpp Jul 19, 2022
@wx257osn2 wx257osn2 changed the title Fix test_cppcontrib_sa_decode.cpp WIP: Fix test_cppcontrib_sa_decode.cpp Jul 19, 2022
@wx257osn2 wx257osn2 changed the title WIP: Fix test_cppcontrib_sa_decode.cpp Fix test_cppcontrib_sa_decode.cpp Jul 19, 2022
@mdouze
Copy link
Contributor

mdouze commented Jul 19, 2022

thanks that sounds good.

@mdouze
Copy link
Contributor

mdouze commented Jul 19, 2022

@alexanderguzhva would you mind taking a look?

@facebook-github-bot
Copy link
Contributor

@alexanderguzhva has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@wx257osn2 wx257osn2 deleted the conform-cxx11 branch July 21, 2022 16:47
BZO95 added a commit to BZO95/faiss that referenced this pull request Apr 10, 2025
Summary:
This PR contains below changes:

- Conform C++11
    - [`faiss` is written in C++11](https://github.com/facebookresearch/faiss/blob/main/CONTRIBUTING.md#coding-style), but [`faiss/cppcontrib/SaDecodeKernels-avx2-inl.h`](https://github.com/facebookresearch/faiss/blob/442d9f4a2d43e2ada6423e8e4e3414131dea849d/faiss/cppcontrib/SaDecodeKernels-avx2-inl.h) and [the test](https://github.com/facebookresearch/faiss/blob/442d9f4a2d43e2ada6423e8e4e3414131dea849d/tests/test_cppcontrib_sa_decode.cpp) use some C++17 features. This PR rewrites these codes to make them independent to C++17.
- Enable AVX2 on `faiss_test`
    - Currently `faiss_test` is compiled without `-mavx2` even if `-DFAISS_OPT_LEVEL=avx2` , so **`tests/test_cppcontrib_sa_decode.cpp` hasn't checked `faiss/cppcontrib/SaDecodeKernels-avx2-inl.h` at all** . This PR adds `-mavx2` to `faiss_test` if `-DFAISS_OPT_LEVEL=avx2` , so now `tests/test_cppcontrib_sa_decode.cpp` confirms `faiss/cppcontrib/SaDecodeKernels-avx2-inl.h` if `-DFAISS_OPT_LEVEL=avx2` , and does `faiss/cppcontrib/SaDecodeKernels-inl.h` if not `-DFAISS_OPT_LEVEL=avx2` .

Pull Request resolved: facebookresearch/faiss#2388

Reviewed By: mdouze

Differential Revision: D38005738

Pulled By: alexanderguzhva

fbshipit-source-id: b9319c585c6849e1c7a4782770f2d7ce8c0d8660
aalekhpatel07 pushed a commit to aalekhpatel07/faiss that referenced this pull request Apr 10, 2025
Summary:
This PR contains below changes:

- Conform C++11
    - [`faiss` is written in C++11](https://github.com/facebookresearch/faiss/blob/main/CONTRIBUTING.md#coding-style), but [`faiss/cppcontrib/SaDecodeKernels-avx2-inl.h`](https://github.com/facebookresearch/faiss/blob/442d9f4a2d43e2ada6423e8e4e3414131dea849d/faiss/cppcontrib/SaDecodeKernels-avx2-inl.h) and [the test](https://github.com/facebookresearch/faiss/blob/442d9f4a2d43e2ada6423e8e4e3414131dea849d/tests/test_cppcontrib_sa_decode.cpp) use some C++17 features. This PR rewrites these codes to make them independent to C++17.
- Enable AVX2 on `faiss_test`
    - Currently `faiss_test` is compiled without `-mavx2` even if `-DFAISS_OPT_LEVEL=avx2` , so **`tests/test_cppcontrib_sa_decode.cpp` hasn't checked `faiss/cppcontrib/SaDecodeKernels-avx2-inl.h` at all** . This PR adds `-mavx2` to `faiss_test` if `-DFAISS_OPT_LEVEL=avx2` , so now `tests/test_cppcontrib_sa_decode.cpp` confirms `faiss/cppcontrib/SaDecodeKernels-avx2-inl.h` if `-DFAISS_OPT_LEVEL=avx2` , and does `faiss/cppcontrib/SaDecodeKernels-inl.h` if not `-DFAISS_OPT_LEVEL=avx2` .

Pull Request resolved: facebookresearch#2388

Reviewed By: mdouze

Differential Revision: D38005738

Pulled By: alexanderguzhva

fbshipit-source-id: b9319c585c6849e1c7a4782770f2d7ce8c0d8660
aalekhpatel07 pushed a commit to aalekhpatel07/faiss that referenced this pull request Apr 10, 2025
Summary:
This PR contains below changes:

- Conform C++11
    - [`faiss` is written in C++11](https://github.com/facebookresearch/faiss/blob/main/CONTRIBUTING.md#coding-style), but [`faiss/cppcontrib/SaDecodeKernels-avx2-inl.h`](https://github.com/facebookresearch/faiss/blob/442d9f4a2d43e2ada6423e8e4e3414131dea849d/faiss/cppcontrib/SaDecodeKernels-avx2-inl.h) and [the test](https://github.com/facebookresearch/faiss/blob/442d9f4a2d43e2ada6423e8e4e3414131dea849d/tests/test_cppcontrib_sa_decode.cpp) use some C++17 features. This PR rewrites these codes to make them independent to C++17.
- Enable AVX2 on `faiss_test`
    - Currently `faiss_test` is compiled without `-mavx2` even if `-DFAISS_OPT_LEVEL=avx2` , so **`tests/test_cppcontrib_sa_decode.cpp` hasn't checked `faiss/cppcontrib/SaDecodeKernels-avx2-inl.h` at all** . This PR adds `-mavx2` to `faiss_test` if `-DFAISS_OPT_LEVEL=avx2` , so now `tests/test_cppcontrib_sa_decode.cpp` confirms `faiss/cppcontrib/SaDecodeKernels-avx2-inl.h` if `-DFAISS_OPT_LEVEL=avx2` , and does `faiss/cppcontrib/SaDecodeKernels-inl.h` if not `-DFAISS_OPT_LEVEL=avx2` .

Pull Request resolved: facebookresearch#2388

Reviewed By: mdouze

Differential Revision: D38005738

Pulled By: alexanderguzhva

fbshipit-source-id: b9319c585c6849e1c7a4782770f2d7ce8c0d8660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants