pgvector.git / summary / log / commit / refs
commit 8d68f88507166dbf1863be20bc3f16abd23b3cd5
Author: Andrew Kane <andrew@ankane.org>
Date: Wed Apr 17 22:05:19 2024 +0000
Improved target_clones logic [skip ci]
src/vector.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/vector.c b/src/vector.c
index 185df279..351e288c 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -34,7 +34,14 @@
#define CreateStateDatums(dim) palloc(sizeof(Datum) * (dim + 1))
/* target_clones requires glibc */
-#if defined(__x86_64__) && defined(__gnu_linux__) && defined(__has_attribute) && __has_attribute(target_clones) && !defined(__FMA__)
+#if defined(__gnu_linux__) && defined(__has_attribute)
+/* Use separate line for portability */
+#if __has_attribute(target_clones)
+#define HAVE_TARGET_CLONES
+#endif
+#endif
+
+#if defined(__x86_64__) && HAVE_TARGET_CLONES && !defined(__FMA__)
#define VECTOR_DISPATCH __attribute__((target_clones("default", "fma")))
#else
#define VECTOR_DISPATCH
[parent: 301c8083f50b]