Skip to content

Commit 4d3b0bc

Browse files
authored
feat: SimSIMD update and integration (#5846)
* fix: SimSIMD updated
1 parent d2e735d commit 4d3b0bc

File tree

5 files changed

+125
-237
lines changed

5 files changed

+125
-237
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
option(ENABLE_GIT_VERSION "Build with Git metadata" OFF)
22

33
option(USE_SIMSIMD "Enable SimSIMD vector optimizations" OFF)
4+
option(SIMSIMD_NATIVE_F16 "Enable native float16 support in SimSIMD" OFF)
45
option(WITH_SEARCH "Enable compilation of search module" ON)
56

67
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")

src/core/search/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ add_library(dfly_search_core base.cc ast_expr.cc query_driver.cc search.cc indic
1212
target_link_libraries(dfly_search_core base redis_lib absl::strings
1313
TRDP::reflex TRDP::uni-algo TRDP::hnswlib)
1414

15+
if(USE_SIMSIMD)
16+
target_link_libraries(dfly_search_core TRDP::simsimd)
17+
target_compile_definitions(dfly_search_core PRIVATE USE_SIMSIMD=1)
18+
19+
# Conditionally disable native float16 support (default behavior)
20+
if(NOT SIMSIMD_NATIVE_F16)
21+
target_compile_definitions(dfly_search_core PRIVATE
22+
SIMSIMD_NATIVE_F16=0
23+
SIMSIMD_NATIVE_BF16=0)
24+
endif()
25+
endif()
26+
1527
cxx_test(compressed_sorted_set_test dfly_search_core LABELS DFLY)
1628
cxx_test(block_list_test dfly_search_core LABELS DFLY)
1729
cxx_test(range_tree_test dfly_search_core LABELS DFLY)
@@ -22,4 +34,11 @@ cxx_test(search_test redis_test_lib dfly_search_core LABELS DFLY)
2234
if(USE_SIMSIMD)
2335
target_link_libraries(search_test TRDP::simsimd)
2436
target_compile_definitions(search_test PRIVATE USE_SIMSIMD=1)
37+
38+
# Conditionally disable native float16 support (default behavior)
39+
if(NOT SIMSIMD_NATIVE_F16)
40+
target_compile_definitions(search_test PRIVATE
41+
SIMSIMD_NATIVE_F16=0
42+
SIMSIMD_NATIVE_BF16=0)
43+
endif()
2544
endif()

0 commit comments

Comments
 (0)