pgvector.git / summary / log / commit / refs
commit 5748cb6b4313d20d46b85a324d6535969c6e7bee
Author: Andrew Kane <andrew@ankane.org>
Date: Mon Apr 26 22:33:11 2021 +0000
Vectorized distance calculations
CHANGELOG.md | 1 +
Makefile | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1bae3410..5c88292b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
## 0.1.2 (unreleased)
+- Vectorized distance calculations
- Improved cost estimation
## 0.1.1 (2021-04-25)
diff --git a/Makefile b/Makefile
index c853d35e..d93d36a5 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,17 @@ TESTS = $(wildcard sql/*.sql)
REGRESS = btree cast copy functions ivfflat_cosine ivfflat_ip ivfflat_l2 ivfflat_unlogged vector
+# For auto-vectorization:
+# - GCC (needs -ftree-vectorize OR -O3) - https://gcc.gnu.org/projects/tree-ssa/vectorization.html
+# - Clang (could use pragma instead) - https://llvm.org/docs/Vectorizers.html
+PG_CFLAGS = -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math
+
+# Debug GCC auto-vectorization
+# PG_CFLAGS += -fopt-info-vec
+
+# Debug Clang auto-vectorization
+# PG_CFLAGS += -Rpass=loop-vectorize -Rpass-analysis=loop-vectorize
+
PG_CONFIG ?= pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
[parent: 60814b8f394f]