Enable dynamic dispatch in SimSIMD

This commit is contained in:
Robert Schulze 2024-11-01 12:55:02 +00:00
parent 9d0f256dfe
commit 3a042c0804
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,8 @@
# See contrib/usearch-cmake/CMakeLists.txt, why only enabled on x86 # See contrib/usearch-cmake/CMakeLists.txt, why only enabled on x86
if (ARCH_AMD64) if (ARCH_AMD64)
set(SIMSIMD_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/SimSIMD") set(SIMSIMD_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/SimSIMD")
add_library(_simsimd INTERFACE) set(SIMSIMD_SRCS ${SIMSIMD_PROJECT_DIR}/c/lib.c)
target_include_directories(_simsimd SYSTEM INTERFACE "${SIMSIMD_PROJECT_DIR}/include") add_library(_simsimd ${SIMSIMD_SRCS})
target_include_directories(_simsimd SYSTEM PUBLIC "${SIMSIMD_PROJECT_DIR}/include")
target_compile_definitions(_simsimd PUBLIC SIMSIMD_DYNAMIC_DISPATCH)
endif() endif()

View File

@ -118,6 +118,8 @@ USearchIndexWithSerialization::USearchIndexWithSerialization(
if (!result) if (!result)
throw Exception(ErrorCodes::INCORRECT_DATA, "Could not create vector similarity index. Error: {}", String(result.error.release())); throw Exception(ErrorCodes::INCORRECT_DATA, "Could not create vector similarity index. Error: {}", String(result.error.release()));
swap(result.index); swap(result.index);
/// LOG_TRACE(getLogger("XXX"), "{}", simsimd_uses_dynamic_dispatch());
} }
void USearchIndexWithSerialization::serialize(WriteBuffer & ostr) const void USearchIndexWithSerialization::serialize(WriteBuffer & ostr) const