Use consistent naming [skip ci]

This commit is contained in:
Andrew Kane
2024-04-08 14:56:59 -07:00
parent 3eba34e5e3
commit 191c8e1cca
3 changed files with 8 additions and 8 deletions

View File

@@ -19,11 +19,11 @@
#endif #endif
#endif #endif
float (*HalfvecL2DistanceSquared) (int dim, half * ax, half * bx); float (*HalfvecL2SquaredDistance) (int dim, half * ax, half * bx);
float (*HalfvecInnerProduct) (int dim, half * ax, half * bx); float (*HalfvecInnerProduct) (int dim, half * ax, half * bx);
static float static float
HalfvecL2DistanceSquaredDefault(int dim, half * ax, half * bx) HalfvecL2SquaredDistanceDefault(int dim, half * ax, half * bx)
{ {
float distance = 0.0; float distance = 0.0;
@@ -40,7 +40,7 @@ HalfvecL2DistanceSquaredDefault(int dim, half * ax, half * bx)
#ifdef HALFVEC_DISPATCH #ifdef HALFVEC_DISPATCH
TARGET_F16C_FMA static float TARGET_F16C_FMA static float
HalfvecL2DistanceSquaredF16cFma(int dim, half * ax, half * bx) HalfvecL2SquaredDistanceF16cFma(int dim, half * ax, half * bx)
{ {
float distance; float distance;
int i; int i;
@@ -143,13 +143,13 @@ HalfvecInit(void)
* Could skip pointer when single function, but no difference in * Could skip pointer when single function, but no difference in
* performance * performance
*/ */
HalfvecL2DistanceSquared = HalfvecL2DistanceSquaredDefault; HalfvecL2SquaredDistance = HalfvecL2SquaredDistanceDefault;
HalfvecInnerProduct = HalfvecInnerProductDefault; HalfvecInnerProduct = HalfvecInnerProductDefault;
#ifdef HALFVEC_DISPATCH #ifdef HALFVEC_DISPATCH
if (SupportsFeature(FEATURE_FMA | FEATURE_F16C)) if (SupportsFeature(FEATURE_FMA | FEATURE_F16C))
{ {
HalfvecL2DistanceSquared = HalfvecL2DistanceSquaredF16cFma; HalfvecL2SquaredDistance = HalfvecL2SquaredDistanceF16cFma;
HalfvecInnerProduct = HalfvecInnerProductF16cFma; HalfvecInnerProduct = HalfvecInnerProductF16cFma;
} }
#endif #endif

View File

@@ -3,7 +3,7 @@
#include "halfvec.h" #include "halfvec.h"
extern float (*HalfvecL2DistanceSquared) (int dim, half * ax, half * bx); extern float (*HalfvecL2SquaredDistance) (int dim, half * ax, half * bx);
extern float (*HalfvecInnerProduct) (int dim, half * ax, half * bx); extern float (*HalfvecInnerProduct) (int dim, half * ax, half * bx);
void HalfvecInit(void); void HalfvecInit(void);

View File

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