From 1f390fb6e905bf4e607f57f8681b36e88957b567 Mon Sep 17 00:00:00 2001 From: Raghuveer Devulapalli Date: Mon, 22 Jan 2024 14:52:55 -0800 Subject: [PATCH 1/2] Build fix on macOS 64-bit --- src/xss-common-argsort.h | 14 ++++++++++++++ src/xss-network-keyvaluesort.hpp | 11 +++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/xss-common-argsort.h b/src/xss-common-argsort.h index c826a527..05605831 100644 --- a/src/xss-common-argsort.h +++ b/src/xss-common-argsort.h @@ -595,10 +595,17 @@ avx2_argsort(T *arr, arrsize_t *arg, arrsize_t arrsize, bool hasnan = false) avx2_half_vector, avx2_vector>::type; +#ifdef __APPLE__ + using argtype = + typename std::conditional, + avx2_vector>::type; +#else using argtype = typename std::conditional, avx2_vector>::type; +#endif if (arrsize > 1) { if constexpr (std::is_floating_point_v) { @@ -685,10 +692,17 @@ X86_SIMD_SORT_INLINE void avx2_argselect(T *arr, avx2_half_vector, avx2_vector>::type; +#ifdef __APPLE__ + using argtype = + typename std::conditional, + avx2_vector>::type; +#else using argtype = typename std::conditional, avx2_vector>::type; +#endif if (arrsize > 1) { if constexpr (std::is_floating_point_v) { diff --git a/src/xss-network-keyvaluesort.hpp b/src/xss-network-keyvaluesort.hpp index 03f15155..8c366a8a 100644 --- a/src/xss-network-keyvaluesort.hpp +++ b/src/xss-network-keyvaluesort.hpp @@ -328,7 +328,8 @@ bitonic_merge_dispatch(typename keyType::reg_t &key, key = bitonic_merge_ymm_64bit(key, value); } else { - static_assert(always_false, "bitonic_merge_dispatch: No implementation"); + static_assert(always_false, + "bitonic_merge_dispatch: No implementation"); UNUSED(key); UNUSED(value); } @@ -349,7 +350,8 @@ X86_SIMD_SORT_INLINE void sort_vec_dispatch(typename keyType::reg_t &key, key = sort_ymm_64bit(key, value); } else { - static_assert(always_false, "sort_vec_dispatch: No implementation"); + static_assert(always_false, + "sort_vec_dispatch: No implementation"); UNUSED(key); UNUSED(value); } @@ -584,8 +586,9 @@ X86_SIMD_SORT_INLINE void kvsort_n_vec(typename keyType::type_t *keys, } template -X86_SIMD_SORT_INLINE void -argsort_n(typename keyType::type_t *keys, arrsize_t *indices, int N) +X86_SIMD_SORT_INLINE void argsort_n(typename keyType::type_t *keys, + typename indexType::type_t *indices, + int N) { static_assert(keyType::numlanes == indexType::numlanes, "invalid pairing of value/index types"); From f979190163e75a35e01a28acee3e84401cf7784e Mon Sep 17 00:00:00 2001 From: Raghuveer Devulapalli Date: Mon, 22 Jan 2024 15:32:55 -0800 Subject: [PATCH 2/2] Disable GCC pragma unroll loop when building with sanitizer --- src/xss-common-includes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xss-common-includes.h b/src/xss-common-includes.h index fadb81f5..98a3fe15 100644 --- a/src/xss-common-includes.h +++ b/src/xss-common-includes.h @@ -65,7 +65,7 @@ #define UNLIKELY(x) (x) #endif -#if __GNUC__ >= 8 +#if __GNUC__ >= 8 and !defined(__SANITIZE_ADDRESS__) #define X86_SIMD_SORT_UNROLL_LOOP(num) PRAGMA(GCC unroll num) #else #define X86_SIMD_SORT_UNROLL_LOOP(num)