Try double

This commit is contained in:
Andrew Kane
2023-10-16 17:00:48 -07:00
parent 1ed278c82c
commit 1184ad9fd3
2 changed files with 2 additions and 24 deletions

View File

@@ -79,23 +79,3 @@ jobs:
shell: cmd
- if: ${{ failure() }}
run: cat regression.diffs
i386:
runs-on: ubuntu-latest
container:
image: debian:11
options: --platform linux/386
steps:
- run: apt-get update && apt-get install -y build-essential git libipc-run-perl postgresql-13 postgresql-server-dev-13 sudo
- run: service postgresql start
- run: |
git clone https://github.com/${{ github.repository }}.git pgvector
cd pgvector
git fetch origin ${{ github.ref }}
git reset --hard FETCH_HEAD
make
make install
chown -R postgres .
sudo -u postgres make installcheck
sudo -u postgres make prove_installcheck
env:
PG_CFLAGS: -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare

View File

@@ -755,7 +755,6 @@ normalize_l2(PG_FUNCTION_ARGS)
Vector *a = PG_GETARG_VECTOR_P(0);
float *ax = a->x;
double norm = 0.0;
float normf;
Vector *result;
float *rx;
@@ -767,13 +766,12 @@ normalize_l2(PG_FUNCTION_ARGS)
norm += (double) ax[i] * (double) ax[i];
norm = sqrt(norm);
normf = (float) norm;
if (normf > 0)
if (norm > 0)
{
/* Auto-vectorized */
for (int i = 0, imax = a->dim; i < imax; i++)
rx[i] = ax[i] / normf;
rx[i] = ax[i] / norm;
/* Check for overflow */
for (int i = 0, imax = a->dim; i < imax; i++)