From 191c8e1ccaecae78e291ecc1bd093d84e9fb1e5e Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 8 Apr 2024 14:56:59 -0700 Subject: [PATCH] Use consistent naming [skip ci] --- src/halfutils.c | 10 +++++----- src/halfutils.h | 2 +- src/halfvec.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/halfutils.c b/src/halfutils.c index 7485e9d..c70fd6d 100644 --- a/src/halfutils.c +++ b/src/halfutils.c @@ -19,11 +19,11 @@ #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); static float -HalfvecL2DistanceSquaredDefault(int dim, half * ax, half * bx) +HalfvecL2SquaredDistanceDefault(int dim, half * ax, half * bx) { float distance = 0.0; @@ -40,7 +40,7 @@ HalfvecL2DistanceSquaredDefault(int dim, half * ax, half * bx) #ifdef HALFVEC_DISPATCH TARGET_F16C_FMA static float -HalfvecL2DistanceSquaredF16cFma(int dim, half * ax, half * bx) +HalfvecL2SquaredDistanceF16cFma(int dim, half * ax, half * bx) { float distance; int i; @@ -143,13 +143,13 @@ HalfvecInit(void) * Could skip pointer when single function, but no difference in * performance */ - HalfvecL2DistanceSquared = HalfvecL2DistanceSquaredDefault; + HalfvecL2SquaredDistance = HalfvecL2SquaredDistanceDefault; HalfvecInnerProduct = HalfvecInnerProductDefault; #ifdef HALFVEC_DISPATCH if (SupportsFeature(FEATURE_FMA | FEATURE_F16C)) { - HalfvecL2DistanceSquared = HalfvecL2DistanceSquaredF16cFma; + HalfvecL2SquaredDistance = HalfvecL2SquaredDistanceF16cFma; HalfvecInnerProduct = HalfvecInnerProductF16cFma; } #endif diff --git a/src/halfutils.h b/src/halfutils.h index cfcb58c..e806811 100644 --- a/src/halfutils.h +++ b/src/halfutils.h @@ -3,7 +3,7 @@ #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); void HalfvecInit(void); diff --git a/src/halfvec.c b/src/halfvec.c index 7e10f6e..ee12cc4 100644 --- a/src/halfvec.c +++ b/src/halfvec.c @@ -813,7 +813,7 @@ halfvec_l2_distance(PG_FUNCTION_ARGS) 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); - PG_RETURN_FLOAT8((double) HalfvecL2DistanceSquared(a->dim, a->x, b->x)); + PG_RETURN_FLOAT8((double) HalfvecL2SquaredDistance(a->dim, a->x, b->x)); } /*