Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: Convert unary_complex from C universal intrinsics to C++ using Highway#28815

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
amane-ame wants to merge2 commits intonumpy:main
base:main
Choose a base branch
Loading
fromamane-ame:hwy-unary_complex

Conversation

amane-ame
Copy link

Based on#28622, merge it first.

seiko2plusand others added2 commitsMay 18, 2025 20:35
A thin wrapper over Google's Highway SIMD library to simplify its interface.This commit provides the implementation of that wrapper, consisting of:- simd.hpp: Main header defining the SIMD namespaces and configuration- simd.inc.hpp: Template header included multiple times with different namespacesThe wrapper eliminates Highway's class tags by:- Using lane types directly which can be deduced from arguments- Leveraging namespaces (np::simd and np::simd128) for different register widthsA README is included to guide usage and document design decisions.SIMD: Update wrapper with improved docs and type support  - Fix hardware/platform terminology in documentation for clarity  - Add support for long double in template specializations  - Add kMaxLanes constant to expose maximum vector width information  - Follows clang formatting style for consistency with NumPy codebase.SIMD: Improve isolation and constexpr handling in wrapper  - Add anonymous namespace around implementation to ensure each    translation unit gets its own constants based on local flags  - Use HWY_LANES_CONSTEXPR for Lanes function to ensure proper    constexpr evaluation across platformsUpdate Highway submodule to latest masterSIMD: Fix compile error by using MaxLanes instead of Lanes for array size  Replace hn::Lanes(f64) with hn::MaxLanes(f64) when defining the index array  size to fix error C2131: "expression did not evaluate to a constant". This error  occurs because Lanes() isn't always constexpr compatible, especially with  scalable vector extensions. MaxLanes() provides a compile-time constant value  suitable for static array allocation and should be used with non-scalable SIMD  extensions when defining fixed-size arrays.SIMD: Rename NPY_SIMDX to NPY_HWYRename Highway wrapper macros for clarity:- NPY_SIMDX → NPY_HWY- NPY_SIMDX_F16 → NPY_HWY_F16- NPY_SIMDX_F64 → NPY_HWY_F64- NPY_SIMDX_FMA → NPY_HWY_FMATo avoids confusion with legacy SIMD macros.
auto infmask = hn::IsInf(smaller);
auto div_mask = hn::ExclusiveNeither(zeromask, infmask);

auto ratio = hn::MaskedDiv(div_mask, smaller, larger);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It seems that MaskedDiv can not be found in RVV (https://github.com/google/highway/blob/master/hwy/ops/rvv-inl.h).

When i compile on BPI-F3(SpacemiT K1 8 core , RVV1.0) , it cause an error.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ixgbe reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Zero masked arithmetic operations :google/highway@046dee2

Fix review comments :google/highway@329e50a

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ixgbeixgbeixgbe left review comments

Assignees
No one assigned
Labels
01 - Enhancementcomponent: SIMDIssues in SIMD (fast instruction sets) code or machinery
Projects
Status: Awaiting a code review
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@amane-ame@ixgbe@charris@seiko2plus

[8]ページ先頭

©2009-2025 Movatter.jp