2024-10-22 09:46:48 -07:00
|
|
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2021-03-04 05:01:59 -08:00
|
|
|
#
|
|
|
|
# This source code is licensed under the MIT license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
|
|
|
|
target_sources(faiss_c PRIVATE
|
|
|
|
DeviceUtils_c.cpp
|
|
|
|
GpuAutoTune_c.cpp
|
|
|
|
GpuClonerOptions_c.cpp
|
|
|
|
GpuIndex_c.cpp
|
|
|
|
GpuResources_c.cpp
|
|
|
|
StandardGpuResources_c.cpp
|
|
|
|
)
|
2021-04-26 02:19:39 -07:00
|
|
|
|
|
|
|
file(GLOB FAISS_C_API_GPU_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
|
|
|
|
faiss_install_headers("${FAISS_C_API_GPU_HEADERS}" c_api/gpu)
|
2021-03-04 05:01:59 -08:00
|
|
|
|
2024-08-02 15:07:01 -07:00
|
|
|
if (FAISS_ENABLE_ROCM)
|
|
|
|
target_link_libraries(faiss_c PUBLIC hip::host roc::hipblas)
|
2024-07-31 15:00:10 -07:00
|
|
|
else()
|
2024-08-02 15:07:01 -07:00
|
|
|
find_package(CUDAToolkit REQUIRED)
|
2024-11-14 11:30:16 -08:00
|
|
|
target_link_libraries(faiss_c PUBLIC CUDA::cudart CUDA::cublas $<$<BOOL:${FAISS_ENABLE_CUVS}>:cuvs::cuvs>)
|
2024-07-31 15:00:10 -07:00
|
|
|
endif()
|
2021-03-04 05:01:59 -08:00
|
|
|
|
|
|
|
add_executable(example_gpu_c EXCLUDE_FROM_ALL example_gpu_c.c)
|
|
|
|
target_link_libraries(example_gpu_c PRIVATE faiss_c)
|