mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-12 07:36:55 +08:00
Fixed auto-vectorization for vector_spherical_distance with MSVC
This commit is contained in:
@@ -695,6 +695,8 @@ vector_spherical_distance(PG_FUNCTION_ARGS)
|
|||||||
{
|
{
|
||||||
Vector *a = PG_GETARG_VECTOR_P(0);
|
Vector *a = PG_GETARG_VECTOR_P(0);
|
||||||
Vector *b = PG_GETARG_VECTOR_P(1);
|
Vector *b = PG_GETARG_VECTOR_P(1);
|
||||||
|
float *ax = a->x;
|
||||||
|
float *bx = b->x;
|
||||||
float dp = 0.0;
|
float dp = 0.0;
|
||||||
double distance;
|
double distance;
|
||||||
|
|
||||||
@@ -702,7 +704,7 @@ vector_spherical_distance(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
/* Auto-vectorized */
|
/* Auto-vectorized */
|
||||||
for (int i = 0; i < a->dim; i++)
|
for (int i = 0; i < a->dim; i++)
|
||||||
dp += a->x[i] * b->x[i];
|
dp += ax[i] * bx[i];
|
||||||
|
|
||||||
distance = (double) dp;
|
distance = (double) dp;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user