mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-14 00:26:55 +08:00
Improved code [skip ci]
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include "bitutils.h"
|
#include "bitutils.h"
|
||||||
|
#include "halfvec.h" /* for USE_DISPATCH and USE_TARGET_CLONES */
|
||||||
#include "port/pg_bitutils.h"
|
#include "port/pg_bitutils.h"
|
||||||
|
|
||||||
|
#if defined(USE_DISPATCH)
|
||||||
|
#define BIT_DISPATCH
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BIT_DISPATCH
|
#ifdef BIT_DISPATCH
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,6 @@
|
|||||||
#error "Requires PostgreSQL 12+"
|
#error "Requires PostgreSQL 12+"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "halfvec.h" /* for USE_DISPATCH and USE_TARGET_CLONES */
|
|
||||||
|
|
||||||
#if defined(USE_DISPATCH)
|
|
||||||
#define BIT_DISPATCH
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern uint64 (*BitHammingDistance) (uint32 bytes, unsigned char *ax, unsigned char *bx, uint64 distance);
|
extern uint64 (*BitHammingDistance) (uint32 bytes, unsigned char *ax, unsigned char *bx, uint64 distance);
|
||||||
extern double (*BitJaccardDistance) (uint32 bytes, unsigned char *ax, unsigned char *bx, uint64 ab, uint64 aa, uint64 bb);
|
extern double (*BitJaccardDistance) (uint32 bytes, unsigned char *ax, unsigned char *bx, uint64 ab, uint64 aa, uint64 bb);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user