Skip to content
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

Add a new architecture mode: 'avx512-sr'. #4025

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ jobs:
uses: ./.github/actions/build_cmake
with:
opt_level: avx512
linux-x86_64-AVX512-cmake:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linux-x86_64-AVX512-advanced-cmake

name: Linux x86_64 AVX512 (advanced) (cmake)
needs: linux-x86_64-cmake
runs-on: faiss-aws-m7i.large
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test (cmake)
uses: ./.github/actions/build_cmake
with:
opt_level: avx512-sr
linux-x86_64-GPU-cmake:
name: Linux x86_64 GPU (cmake)
needs: linux-x86_64-cmake
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
/tests/gtest/
faiss/python/swigfaiss_avx2.swig
faiss/python/swigfaiss_avx512.swig
faiss/python/swigfaiss_avx512_sr.swig
faiss/python/swigfaiss_sve.swig
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ set(CMAKE_CXX_STANDARD 17)

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

# Valid values are "generic", "avx2", "avx512", "sve".
# Valid values are "generic", "avx2", "avx512", "avx512-sr", "sve".
option(FAISS_OPT_LEVEL "" "generic")
option(FAISS_ENABLE_GPU "Enable support for GPU indexes." ON)
option(FAISS_ENABLE_RAFT "Enable RAFT for GPU indexes." OFF)
Expand Down
8 changes: 7 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Several options can be passed to CMake, among which:
optimization options (enables `-O3` on gcc for instance),
- `-DFAISS_OPT_LEVEL=avx2` in order to enable the required compiler flags to
generate code using optimized SIMD/Vector instructions. Possible values are below:
- On x86-64, `generic`, `avx2` and `avx512`, by increasing order of optimization,
- On x86-64, `generic`, `avx2`, 'avx512', and `avx512-sr`, by increasing order of optimization,
- On aarch64, `generic` and `sve`, by increasing order of optimization,
- `-DFAISS_USE_LTO=ON` in order to enable [Link-Time Optimization](https://en.wikipedia.org/wiki/Link-time_optimization) (default is `OFF`, possible values are `ON` and `OFF`).
- BLAS-related options:
Expand Down Expand Up @@ -180,6 +180,12 @@ For AVX512:
$ make -C build -j faiss_avx512
```

For AVX512 (advanced):

``` shell
$ make -C build -j faiss_avx512_sr
```

This will ensure the creation of neccesary files when building and installing the python package.

## Step 3: Building the python bindings (optional)
Expand Down
13 changes: 12 additions & 1 deletion cmake/link_to_faiss_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree.

function(link_to_faiss_lib target)
if(NOT FAISS_OPT_LEVEL STREQUAL "avx2" AND NOT FAISS_OPT_LEVEL STREQUAL "avx512" AND NOT FAISS_OPT_LEVEL STREQUAL "sve")
if(NOT FAISS_OPT_LEVEL STREQUAL "avx2" AND NOT FAISS_OPT_LEVEL STREQUAL "avx512" AND NOT FAISS_OPT_LEVEL STREQUAL "avx512-sr" AND NOT FAISS_OPT_LEVEL STREQUAL "sve")
target_link_libraries(${target} PRIVATE faiss)
endif()

Expand All @@ -27,6 +27,17 @@ function(link_to_faiss_lib target)
target_link_libraries(${target} PRIVATE faiss_avx512)
endif()

if(FAISS_OPT_LEVEL STREQUAL "avx512-sr")
if(NOT WIN32)
# Architecture mode to support AVX512 extensions available since Intel (R) Sapphire Rapids.
# Ref: https://networkbuilders.intel.com/solutionslibrary/intel-avx-512-fp16-instruction-set-for-intel-xeon-processor-based-products-technology-guide
target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-mavx2 -mfma -mavx512f -mavx512f -mavx512cd -mavx512vl -mavx512dq -mavx512bw -mavx512vpopcntdq -mavx512fp16>)
else()
target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:/arch:AVX512>)
endif()
target_link_libraries(${target} PRIVATE faiss_avx512_sr)
endif()

if(FAISS_OPT_LEVEL STREQUAL "sve")
if(NOT WIN32)
if("${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} " MATCHES "(^| )-march=native")
Expand Down
6 changes: 3 additions & 3 deletions conda/faiss-gpu-raft/build-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
set -e


# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so
# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so/libfaiss_avx512_sr.so
cmake -B _build \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DFAISS_OPT_LEVEL=avx512 \
-DFAISS_OPT_LEVEL=avx512-sr \
-DFAISS_ENABLE_GPU=ON \
-DFAISS_ENABLE_RAFT=ON \
-DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCHS}" \
Expand All @@ -20,7 +20,7 @@ cmake -B _build \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release .

make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512
make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512 faiss_avx512_sr

cmake --install _build --prefix $PREFIX
cmake --install _build --prefix _libfaiss_stage/
6 changes: 3 additions & 3 deletions conda/faiss-gpu-raft/build-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
set -e


# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512.so
# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512.so/swigfaiss_avx512_sr.so
cmake -B _build_python_${PY_VER} \
-Dfaiss_ROOT=_libfaiss_stage/ \
-DFAISS_OPT_LEVEL=avx512 \
-DFAISS_OPT_LEVEL=avx512-sr \
-DFAISS_ENABLE_GPU=ON \
-DFAISS_ENABLE_RAFT=ON \
-DCMAKE_BUILD_TYPE=Release \
-DPython_EXECUTABLE=$PYTHON \
faiss/python

make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512
make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512 swigfaiss_avx512_sr

# Build actual python module.
cd _build_python_${PY_VER}/
Expand Down
6 changes: 3 additions & 3 deletions conda/faiss-gpu/build-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ if [ -n "$FAISS_FLATTEN_CONDA_INCLUDES" ] && [ "$FAISS_FLATTEN_CONDA_INCLUDES" =
cp -r -n "$CONDA_PREFIX/x86_64-conda-linux-gnu/include/c++/11.2.0/x86_64-conda-linux-gnu/"* "$CONDA_PREFIX/include/"
fi

# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so
# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so/libfaiss_avx512_sr.so
cmake -B _build \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DFAISS_OPT_LEVEL=avx512 \
-DFAISS_OPT_LEVEL=avx512-sr \
-DFAISS_ENABLE_GPU=ON \
-DFAISS_ENABLE_RAFT=OFF \
-DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCHS}" \
Expand All @@ -26,7 +26,7 @@ cmake -B _build \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release .

make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512
make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512 faiss_avx512_sr

cmake --install _build --prefix $PREFIX
cmake --install _build --prefix _libfaiss_stage/
6 changes: 3 additions & 3 deletions conda/faiss-gpu/build-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
set -e


# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512.so
# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512.so/swigfaiss_avx512_sr.so
cmake -B _build_python_${PY_VER} \
-Dfaiss_ROOT=_libfaiss_stage/ \
-DFAISS_OPT_LEVEL=avx512 \
-DFAISS_OPT_LEVEL=avx512-sr \
-DFAISS_ENABLE_GPU=ON \
-DFAISS_ENABLE_RAFT=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DPython_EXECUTABLE=$PYTHON \
faiss/python

make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512
make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512 swigfaiss_avx512_sr

# Build actual python module.
cd _build_python_${PY_VER}/
Expand Down
6 changes: 3 additions & 3 deletions conda/faiss/build-lib-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
set -e


# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so
# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so/libfaiss_avx512_sr.so
cmake -B _build \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DFAISS_OPT_LEVEL=avx512 \
-DFAISS_OPT_LEVEL=avx512-sr \
-DFAISS_ENABLE_GPU=OFF \
-DFAISS_ENABLE_PYTHON=OFF \
-DBLA_VENDOR=Intel10_64lp \
Expand All @@ -21,7 +21,7 @@ cmake -B _build \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release .

make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512
make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512 faiss_avx512_sr

cmake --install _build --prefix $PREFIX
cmake --install _build --prefix _libfaiss_stage/
6 changes: 3 additions & 3 deletions conda/faiss/build-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
set -e


# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so
# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so/libfaiss_avx512_sr.so
cmake -B _build \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DFAISS_OPT_LEVEL=avx512 \
-DFAISS_OPT_LEVEL=avx512-sr \
-DFAISS_ENABLE_GPU=OFF \
-DFAISS_ENABLE_PYTHON=OFF \
-DBLA_VENDOR=Intel10_64lp \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release .

make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512
make -C _build -j$(nproc) faiss faiss_avx2 faiss_avx512 faiss_avx512_sr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for faiss's conda packaging upload. I don't think we want to expose this build mode yet in conda officially. Can you omit this for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.


cmake --install _build --prefix $PREFIX
cmake --install _build --prefix _libfaiss_stage/
6 changes: 3 additions & 3 deletions conda/faiss/build-pkg-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
set -e


# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512
# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512/swigfaiss_avx512_sr.so
cmake -B _build_python_${PY_VER} \
-Dfaiss_ROOT=_libfaiss_stage/ \
-DFAISS_OPT_LEVEL=avx512 \
-DFAISS_OPT_LEVEL=avx512-sr \
-DFAISS_ENABLE_GPU=OFF \
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \
-DOpenMP_CXX_LIB_NAMES=libiomp5 \
Expand All @@ -19,7 +19,7 @@ cmake -B _build_python_${PY_VER} \
-DPython_EXECUTABLE=$PYTHON \
faiss/python

make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512
make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512 swigfaiss_avx512_sr

# Build actual python module.
cd _build_python_${PY_VER}/
Expand Down
6 changes: 3 additions & 3 deletions conda/faiss/build-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
set -e


# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512.so
# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512.so/swigfaiss_avx512_sr.so
cmake -B _build_python_${PY_VER} \
-Dfaiss_ROOT=_libfaiss_stage/ \
-DFAISS_OPT_LEVEL=avx512 \
-DFAISS_OPT_LEVEL=avx512-sr \
-DFAISS_ENABLE_GPU=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DPython_EXECUTABLE=$PYTHON \
faiss/python

make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512
make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512 swigfaiss_avx512_sr

# Build actual python module.
cd _build_python_${PY_VER}/
Expand Down
35 changes: 33 additions & 2 deletions faiss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ set(FAISS_HEADERS ${FAISS_HEADERS} PARENT_SCOPE)
add_library(faiss ${FAISS_SRC})

add_library(faiss_avx2 ${FAISS_SRC})
if(NOT FAISS_OPT_LEVEL STREQUAL "avx2" AND NOT FAISS_OPT_LEVEL STREQUAL "avx512")
if(NOT FAISS_OPT_LEVEL STREQUAL "avx2" AND NOT FAISS_OPT_LEVEL STREQUAL "avx512" AND NOT FAISS_OPT_LEVEL STREQUAL "avx512-sr")
set_target_properties(faiss_avx2 PROPERTIES EXCLUDE_FROM_ALL TRUE)
endif()
if(NOT WIN32)
Expand Down Expand Up @@ -263,6 +263,20 @@ else()
add_compile_options(/bigobj)
endif()

add_library(faiss_avx512_sr ${FAISS_SRC})
if(NOT FAISS_OPT_LEVEL STREQUAL "avx512-sr")
set_target_properties(faiss_avx512_sr PROPERTIES EXCLUDE_FROM_ALL TRUE)
endif()
if(NOT WIN32)
# Architecture mode to support AVX512 extensions available since Intel(R) Sapphire Rapids.
# Ref: https://networkbuilders.intel.com/solutionslibrary/intel-avx-512-fp16-instruction-set-for-intel-xeon-processor-based-products-technology-guide
target_compile_options(faiss_avx512_sr PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-mavx2 -mfma -mf16c -mavx512f -mavx512cd -mavx512vl -mavx512dq -mavx512bw -mpopcnt -mavx512vpopcntdq -mavx512fp16>)
else()
target_compile_options(faiss_avx512_sr PRIVATE $<$<COMPILE_LANGUAGE:CXX>:/arch:AVX512>)
# we need bigobj for the swig wrapper
add_compile_options(/bigobj)
endif()

add_library(faiss_sve ${FAISS_SRC})
if(NOT FAISS_OPT_LEVEL STREQUAL "sve")
set_target_properties(faiss_sve PROPERTIES EXCLUDE_FROM_ALL TRUE)
Expand Down Expand Up @@ -298,10 +312,13 @@ target_include_directories(faiss_avx2 PUBLIC
target_include_directories(faiss_avx512 PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
# Handle `#include <faiss/foo.h>`.
target_include_directories(faiss_avx512_sr PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
# Handle `#include <faiss/foo.h>`.
target_include_directories(faiss_sve PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)

set_target_properties(faiss faiss_avx2 faiss_avx512 faiss_sve PROPERTIES
set_target_properties(faiss faiss_avx2 faiss_avx512 faiss_avx512_sr faiss_sve PROPERTIES
POSITION_INDEPENDENT_CODE ON
WINDOWS_EXPORT_ALL_SYMBOLS ON
)
Expand All @@ -310,6 +327,7 @@ if(WIN32)
target_compile_definitions(faiss PRIVATE FAISS_MAIN_LIB)
target_compile_definitions(faiss_avx2 PRIVATE FAISS_MAIN_LIB)
target_compile_definitions(faiss_avx512 PRIVATE FAISS_MAIN_LIB)
target_compile_definitions(faiss_avx512_sr PRIVATE FAISS_MAIN_LIB)
target_compile_definitions(faiss_sve PRIVATE FAISS_MAIN_LIB)
endif()

Expand All @@ -319,6 +337,7 @@ if (${finteger_idx} EQUAL -1)
endif()
target_compile_definitions(faiss_avx2 PRIVATE FINTEGER=int)
target_compile_definitions(faiss_avx512 PRIVATE FINTEGER=int)
target_compile_definitions(faiss_avx512_sr PRIVATE FINTEGER=int)
target_compile_definitions(faiss_sve PRIVATE FINTEGER=int)

if(FAISS_USE_LTO)
Expand All @@ -330,6 +349,7 @@ if(FAISS_USE_LTO)
set_property(TARGET faiss PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
set_property(TARGET faiss_avx2 PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
set_property(TARGET faiss_avx512 PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
set_property(TARGET faiss_avx512_sr PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "LTO not supported: <${ipo_error}>")
endif()
Expand All @@ -339,24 +359,28 @@ find_package(OpenMP REQUIRED)
target_link_libraries(faiss PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(faiss_avx2 PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(faiss_avx512 PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(faiss_avx512_sr PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(faiss_sve PRIVATE OpenMP::OpenMP_CXX)

find_package(MKL)
if(MKL_FOUND)
target_link_libraries(faiss PRIVATE ${MKL_LIBRARIES})
target_link_libraries(faiss_avx2 PRIVATE ${MKL_LIBRARIES})
target_link_libraries(faiss_avx512 PRIVATE ${MKL_LIBRARIES})
target_link_libraries(faiss_avx512_sr PRIVATE ${MKL_LIBRARIES})
else()
find_package(BLAS REQUIRED)
target_link_libraries(faiss PRIVATE ${BLAS_LIBRARIES})
target_link_libraries(faiss_avx2 PRIVATE ${BLAS_LIBRARIES})
target_link_libraries(faiss_avx512 PRIVATE ${BLAS_LIBRARIES})
target_link_libraries(faiss_avx512_sr PRIVATE ${BLAS_LIBRARIES})
target_link_libraries(faiss_sve PRIVATE ${BLAS_LIBRARIES})

find_package(LAPACK REQUIRED)
target_link_libraries(faiss PRIVATE ${LAPACK_LIBRARIES})
target_link_libraries(faiss_avx2 PRIVATE ${LAPACK_LIBRARIES})
target_link_libraries(faiss_avx512 PRIVATE ${LAPACK_LIBRARIES})
target_link_libraries(faiss_avx512_sr PRIVATE ${LAPACK_LIBRARIES})
target_link_libraries(faiss_sve PRIVATE ${LAPACK_LIBRARIES})
endif()

Expand All @@ -381,6 +405,13 @@ if(FAISS_OPT_LEVEL STREQUAL "avx512")
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
if(FAISS_OPT_LEVEL STREQUAL "avx512-sr")
install(TARGETS faiss_avx2 faiss_avx512 faiss_avx512_sr
EXPORT faiss-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
if(FAISS_OPT_LEVEL STREQUAL "sve")
install(TARGETS faiss_sve
EXPORT faiss-targets
Expand Down
2 changes: 2 additions & 0 deletions faiss/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ if(FAISS_ENABLE_RAFT)
target_compile_definitions(faiss PUBLIC USE_NVIDIA_RAFT=1)
target_compile_definitions(faiss_avx2 PUBLIC USE_NVIDIA_RAFT=1)
target_compile_definitions(faiss_avx512 PUBLIC USE_NVIDIA_RAFT=1)
target_compile_definitions(faiss_avx512_sr PUBLIC USE_NVIDIA_RAFT=1)

# Mark all functions as hidden so that we don't generate
# global 'public' functions that also exist in libraft.so
Expand Down Expand Up @@ -305,6 +306,7 @@ set(FAISS_GPU_HEADERS ${FAISS_GPU_HEADERS} PARENT_SCOPE)
target_link_libraries(faiss PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu>")
target_link_libraries(faiss_avx2 PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu>")
target_link_libraries(faiss_avx512 PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu>")
target_link_libraries(faiss_avx512_sr PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu>")
target_link_libraries(faiss_sve PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu>")

foreach(header ${FAISS_GPU_HEADERS})
Expand Down
Loading