Added CPU dispatching for halfvec distance functions - #311

Co-authored-by: Arda Aytekin <arda.aytekin@microsoft.com>
This commit is contained in:
Andrew Kane
2024-04-08 13:50:18 -07:00
parent 60b4bb2ad1
commit 21bcff6722
5 changed files with 106 additions and 43 deletions

View File

@@ -813,7 +813,7 @@ halfvec_l2_distance(PG_FUNCTION_ARGS)
CheckDims(a, b);
PG_RETURN_FLOAT8(sqrt(HalfvecL2DistanceSquared(a, b)));
PG_RETURN_FLOAT8(sqrt((double) HalfvecL2DistanceSquared(a->dim, a->x, b->x)));
}
/*
@@ -828,7 +828,7 @@ halfvec_l2_squared_distance(PG_FUNCTION_ARGS)
CheckDims(a, b);
PG_RETURN_FLOAT8(HalfvecL2DistanceSquared(a, b));
PG_RETURN_FLOAT8((double) HalfvecL2DistanceSquared(a->dim, a->x, b->x));
}
/*
@@ -843,7 +843,7 @@ halfvec_inner_product(PG_FUNCTION_ARGS)
CheckDims(a, b);
PG_RETURN_FLOAT8(HalfvecInnerProduct(a, b));
PG_RETURN_FLOAT8((double) HalfvecInnerProduct(a->dim, a->x, b->x));
}
/*
@@ -858,7 +858,7 @@ halfvec_negative_inner_product(PG_FUNCTION_ARGS)
CheckDims(a, b);
PG_RETURN_FLOAT8(-HalfvecInnerProduct(a, b));
PG_RETURN_FLOAT8((double) -HalfvecInnerProduct(a->dim, a->x, b->x));
}
/*