pgvector.git / summary / log / commit / refs
commit 5e98f455e3c11d4f263cb9473bb2f3e5d9e18ab7
Author: Andrew Kane <andrew@ankane.org>
Date: Fri Apr 26 02:39:00 2024 +0000
Moved dispatching defines to halfvec.h [skip ci]
src/bitutils.h | 20 ++------------------
src/halfvec.h | 18 +++++++++++++++++-
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/src/bitutils.h b/src/bitutils.h
index 8844aeec..ae3a5759 100644
--- a/src/bitutils.h
+++ b/src/bitutils.h
@@ -3,29 +3,13 @@
#include "postgres.h"
+#include "halfvec.h" /* for USE_DISPATCH */
+
/* Check version in first header */
#if PG_VERSION_NUM < 120000
#error "Requires PostgreSQL 12+"
#endif
-/* We use two types of dispatching: intrinsics and target_clones */
-/* TODO Move to better place */
-#ifndef DISABLE_DISPATCH
-/* Only enable for more recent compilers to keep build process simple */
-#if defined(__x86_64__) && defined(__GNUC__) && __GNUC__ >= 8
-#define USE_DISPATCH
-#elif defined(__x86_64__) && defined(__clang_major__) && __clang_major__ >= 7
-#define USE_DISPATCH
-#elif defined(_M_AMD64) && defined(_MSC_VER) && _MSC_VER >= 1920
-#define USE_DISPATCH
-#endif
-#endif
-
-/* target_clones requires glibc */
-#if defined(USE_DISPATCH) && defined(__gnu_linux__)
-#define USE_TARGET_CLONES
-#endif
-
#if defined(USE_DISPATCH)
#define BIT_DISPATCH
#endif
diff --git a/src/halfvec.h b/src/halfvec.h
index 6b76fcb6..d5c56d38 100644
--- a/src/halfvec.h
+++ b/src/halfvec.h
@@ -5,7 +5,23 @@
#include <float.h>
-#include "bitutils.h"
+/* We use two types of dispatching: intrinsics and target_clones */
+/* TODO Move to better place */
+#ifndef DISABLE_DISPATCH
+/* Only enable for more recent compilers to keep build process simple */
+#if defined(__x86_64__) && defined(__GNUC__) && __GNUC__ >= 8
+#define USE_DISPATCH
+#elif defined(__x86_64__) && defined(__clang_major__) && __clang_major__ >= 7
+#define USE_DISPATCH
+#elif defined(_M_AMD64) && defined(_MSC_VER) && _MSC_VER >= 1920
+#define USE_DISPATCH
+#endif
+#endif
+
+/* target_clones requires glibc */
+#if defined(USE_DISPATCH) && defined(__gnu_linux__)
+#define USE_TARGET_CLONES
+#endif
#if defined(USE_DISPATCH)
#define HALFVEC_DISPATCH
[parent: 498a39d79b33]