Skip to content

Commit 1372aeb

Browse files
author
Raghuveer Devulapalli
authored
Merge pull request #122 from r-devulap/np-ci-fail-fix
Build fix on macOS 64-bit
2 parents 978731d + f979190 commit 1372aeb

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

src/xss-common-argsort.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,10 +595,17 @@ avx2_argsort(T *arr, arrsize_t *arg, arrsize_t arrsize, bool hasnan = false)
595595
avx2_half_vector<T>,
596596
avx2_vector<T>>::type;
597597

598+
#ifdef __APPLE__
599+
using argtype =
600+
typename std::conditional<sizeof(arrsize_t) == sizeof(int32_t),
601+
avx2_half_vector<uint32_t>,
602+
avx2_vector<uint64_t>>::type;
603+
#else
598604
using argtype =
599605
typename std::conditional<sizeof(arrsize_t) == sizeof(int32_t),
600606
avx2_half_vector<arrsize_t>,
601607
avx2_vector<arrsize_t>>::type;
608+
#endif
602609

603610
if (arrsize > 1) {
604611
if constexpr (std::is_floating_point_v<T>) {
@@ -685,10 +692,17 @@ X86_SIMD_SORT_INLINE void avx2_argselect(T *arr,
685692
avx2_half_vector<T>,
686693
avx2_vector<T>>::type;
687694

695+
#ifdef __APPLE__
696+
using argtype =
697+
typename std::conditional<sizeof(arrsize_t) == sizeof(int32_t),
698+
avx2_half_vector<uint32_t>,
699+
avx2_vector<uint64_t>>::type;
700+
#else
688701
using argtype =
689702
typename std::conditional<sizeof(arrsize_t) == sizeof(int32_t),
690703
avx2_half_vector<arrsize_t>,
691704
avx2_vector<arrsize_t>>::type;
705+
#endif
692706

693707
if (arrsize > 1) {
694708
if constexpr (std::is_floating_point_v<T>) {

src/xss-common-includes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
#define UNLIKELY(x) (x)
6666
#endif
6767

68-
#if __GNUC__ >= 8
68+
#if __GNUC__ >= 8 and !defined(__SANITIZE_ADDRESS__)
6969
#define X86_SIMD_SORT_UNROLL_LOOP(num) PRAGMA(GCC unroll num)
7070
#else
7171
#define X86_SIMD_SORT_UNROLL_LOOP(num)

src/xss-network-keyvaluesort.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ bitonic_merge_dispatch(typename keyType::reg_t &key,
328328
key = bitonic_merge_ymm_64bit<keyType, valueType>(key, value);
329329
}
330330
else {
331-
static_assert(always_false<keyType>, "bitonic_merge_dispatch: No implementation");
331+
static_assert(always_false<keyType>,
332+
"bitonic_merge_dispatch: No implementation");
332333
UNUSED(key);
333334
UNUSED(value);
334335
}
@@ -349,7 +350,8 @@ X86_SIMD_SORT_INLINE void sort_vec_dispatch(typename keyType::reg_t &key,
349350
key = sort_ymm_64bit<keyType, valueType>(key, value);
350351
}
351352
else {
352-
static_assert(always_false<keyType>, "sort_vec_dispatch: No implementation");
353+
static_assert(always_false<keyType>,
354+
"sort_vec_dispatch: No implementation");
353355
UNUSED(key);
354356
UNUSED(value);
355357
}
@@ -584,8 +586,9 @@ X86_SIMD_SORT_INLINE void kvsort_n_vec(typename keyType::type_t *keys,
584586
}
585587

586588
template <typename keyType, typename indexType, int maxN>
587-
X86_SIMD_SORT_INLINE void
588-
argsort_n(typename keyType::type_t *keys, arrsize_t *indices, int N)
589+
X86_SIMD_SORT_INLINE void argsort_n(typename keyType::type_t *keys,
590+
typename indexType::type_t *indices,
591+
int N)
589592
{
590593
static_assert(keyType::numlanes == indexType::numlanes,
591594
"invalid pairing of value/index types");

0 commit comments

Comments
 (0)