mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 00:36:56 +02:00
Add unit tests for distance functions (L2, cosine, hamming)
Add test-only wrappers behind SQLITE_VEC_TEST compile flag to expose static distance functions for unit testing. Includes tests for distance_l2_sqr_float (4 cases), distance_cosine_float (3 cases), and distance_hamming (4 cases). Print active SIMD flags at test start. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
79d5818015
commit
aab9b37de2
4 changed files with 141 additions and 1 deletions
|
|
@ -75,4 +75,10 @@ int vec0_parse_partition_key_definition(const char *source, int source_length,
|
|||
int *out_column_name_length,
|
||||
int *out_column_type);
|
||||
|
||||
#ifdef SQLITE_VEC_TEST
|
||||
float _test_distance_l2_sqr_float(const float *a, const float *b, size_t dims);
|
||||
float _test_distance_cosine_float(const float *a, const float *b, size_t dims);
|
||||
float _test_distance_hamming(const unsigned char *a, const unsigned char *b, size_t dims);
|
||||
#endif
|
||||
|
||||
#endif /* SQLITE_VEC_INTERNAL_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue