Skip to content

Commit

Permalink
Make: Avoid SimSIMD inner dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Mar 26, 2024
1 parent 8b8d2f5 commit 28b0850
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@ function (setup_target TARGET_NAME)
target_compile_definitions(${TARGET_NAME} PRIVATE "USEARCH_USE_FP16LIB=$<BOOL:${USEARCH_USE_FP16LIB}>")
target_compile_definitions(${TARGET_NAME} PRIVATE "USEARCH_USE_SIMSIMD=$<BOOL:${USEARCH_USE_SIMSIMD}>")

# Compile SimSIMD dynamic dispatch from source
if (USEARCH_USE_SIMSIMD)
target_compile_definitions(${TARGET_NAME} PRIVATE "SIMSIMD_DYNAMIC_DISPATCH=1")
target_sources(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/simsimd/c/lib.c")
endif ()
endfunction ()

if (${USEARCH_BUILD_TEST_CPP} OR ${USEARCH_BUILD_BENCH_CPP})
Expand Down
1 change: 0 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ fn main() {

build
.file("rust/lib.cpp")
.file("simsimd/c/lib.c")
.flag_if_supported("-Wno-unknown-pragmas")
.warnings(false)
.include("include")
Expand Down
1 change: 1 addition & 0 deletions include/usearch/index_plugins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#if USEARCH_USE_SIMSIMD
// Propagate the `f16` settings
#define SIMSIMD_NATIVE_F16 !USEARCH_USE_FP16LIB
#define SIMSIMD_DYNAMIC_DISPATCH 0
#include <simsimd/simsimd.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion simsimd

0 comments on commit 28b0850

Please sign in to comment.