Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix compile error when sizeof(long double)==sizeof(double)[8]
  • Loading branch information
ixgbe committed Aug 18, 2025
commit d1d2c648582ce6a22bb95be93c35d132bd441b51
12 changes: 9 additions & 3 deletions numpy/_core/src/multiarray/argfunc.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ template <typename T>
struct OpGt {
using Degraded = std::conditional_t<std::is_same_v<T, long double>, OpGt<double>, OpGt<T>>;
#if NPY_HWY
template <typename D = T, typename = std::enable_if_t<kSupportLane<D>>, typename V = Vec<D>>
template <
typename D = T,
typename = std::enable_if_t<kSupportLane<D> && !std::is_same_v<D, long double>,
typename V = Vec<D> >
HWY_INLINE HWY_ATTR auto operator()(const V &a, const V &b) const {
return hn::Gt(a, b);
}
Expand All @@ -33,7 +36,10 @@ template <typename T>
struct OpLt {
using Degraded = std::conditional_t<std::is_same_v<T, long double>, OpLt<double>, OpLt<T>>;
#if NPY_HWY
template <typename D = T, typename = std::enable_if_t<kSupportLane<D>>, typename V = Vec<D>>
template <
typename D = T,
typename = std::enable_if_t<kSupportLane<D> && !std::is_same_v<D, long double>,
typename V = Vec<D> >
HWY_INLINE HWY_ATTR auto operator()(const V &a, const V &b) const {
return hn::Lt(a, b);
}
Expand Down Expand Up @@ -313,7 +319,7 @@ arg_max_min_func(T *ip, npy_intp n, npy_intp *mindx)
}

#if NPY_HWY
if constexpr (kSupportLane<T>) {
if constexpr (kSupportLane<T> && std::is_same_v<T, D>) {
if constexpr (sizeof(T) <= 2) {
*mindx = simd_argfunc_small<D, typename Op::Degraded>(ip, n);
return 0;
Expand Down
Loading