8000 ENH: Convert comparison from C universal intrinsics to C++ using Highway by ixgbe · Pull Request #28490 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Convert comparison from C universal intrinsics to C++ using Highway #28490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
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[2]: cannot convert long unsigned int to unsigned int
  • Loading branch information
ixgbe committed Mar 17, 2025
commit 62cea2aa8d169d3bef88adcca6b4c8445425d465
10 changes: 5 additions & 5 deletions numpy/_core/src/umath/loops_comparison.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ using vec_s64 = hn::Vec<decltype(s64)>;
using vec_f32 = hn::Vec<decltype(f32)>;
using vec_f64 = hn::Vec<decltype(f64)>;

HWY_INLINE vec_u8 simd_pack_b8_b16(vec_u16 a, vec_u16 b) {
HWY_INLINE HWY_ATTR vec_u8 simd_pack_b8_b16(vec_u16 a, vec_u16 b) {
return hn::OrderedTruncate2To(u8, a, b);
}

HWY_INLINE vec_u8 simd_pack_b8_b32(vec_u32 a, vec_u32 b, vec_u32 c, vec_u32 d) {
HWY_INLINE HWY_ATTR vec_u8 simd_pack_b8_b32(vec_u32 a, vec_u32 b, vec_u32 c, vec_u32 d) {
auto ab = hn::OrderedTruncate2To(u16, a, b);
auto cd = hn::OrderedTruncate2To(u16, c, d);
return simd_pack_b8_b16(ab, cd);
}

HWY_INLINE vec_u8 simd_pack_b8_b64(vec_u64 a, vec_u64 b, vec_u64 c, vec_u64 d,
HWY_INLINE HWY_ATTR vec_u8 simd_pack_b8_b64(vec_u64 a, vec_u64 b, vec_u64 c, vec_u64 d,
vec_u64 e, vec_u64 f, vec_u64 g, vec_u64 h) {
auto ab = hn::OrderedTruncate2To(u32, a, b);
auto cd = hn::OrderedTruncate2To(u32, c, d);
Expand Down Expand Up @@ -124,7 +124,7 @@ struct TypeTraits<int16_t> {

template<>
struct TypeTraits<uint32_t> {
using ScalarType = npyv_lanetype_u32;
using ScalarType = uint32_t;
using ScalarType2 = npy_uint;
using VecType = vec_u32;
static constexpr auto Tag = u32;
Expand All @@ -137,7 +137,7 @@ struct TypeTraits<uint32_t> {

template<>
struct TypeTraits<int32_t> {
using ScalarType = npyv_lanetype_s32;
using ScalarType = int32_t;
using ScalarType2 = npy_int;
using VecType = vec_s32;
static constexpr auto Tag = s32;
Expand Down
Loading
0