2023-08-17 12:20:45 +00:00
|
|
|
set(FP16_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/FP16")
|
2024-05-11 13:05:24 +00:00
|
|
|
set(SIMSIMD_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/SimSIMD")
|
|
|
|
set(USEARCH_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/usearch")
|
2023-08-17 12:20:45 +00:00
|
|
|
|
2023-08-15 12:00:27 +00:00
|
|
|
add_library(_usearch INTERFACE)
|
2023-08-17 12:20:45 +00:00
|
|
|
|
|
|
|
target_include_directories(_usearch SYSTEM INTERFACE
|
|
|
|
${FP16_PROJECT_DIR}/include
|
|
|
|
${SIMSIMD_PROJECT_DIR}/include
|
2024-05-11 13:05:24 +00:00
|
|
|
${USEARCH_PROJECT_DIR}/include)
|
2023-08-15 12:00:27 +00:00
|
|
|
|
2024-08-14 15:03:55 +00:00
|
|
|
target_compile_definitions(_usearch INTERFACE USEARCH_USE_FP16LIB)
|
|
|
|
|
|
|
|
# target_compile_definitions(_usearch INTERFACE USEARCH_USE_SIMSIMD)
|
|
|
|
# ^^ simsimd is not enabled at the moment. Reasons:
|
|
|
|
# - Vectorization is important for raw scans but not so much for HNSW. We use usearch only for HNSW.
|
|
|
|
# - Simsimd does compile-time dispatch (choice of SIMD kernels determined by capabilities of the build machine) or dynamic dispatch (SIMD
|
|
|
|
# kernels chosen at runtime based on cpuid instruction). Since current builds are limited to SSE 4.2 (x86) and NEON (ARM), the speedup of
|
|
|
|
# the former would be moderate compared to AVX-512 / SVE. The latter is at the moment too fragile with respect to portability across x86
|
|
|
|
# and ARM machines ... certain conbinations of quantizations / distance functions / SIMD instructions are not implemented at the moment.
|
|
|
|
|
2023-08-15 12:00:27 +00:00
|
|
|
add_library(ch_contrib::usearch ALIAS _usearch)
|