Skip to content
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

ENH: Add SIMD operations for min and max value comparision #18889

Merged
merged 2 commits into from
May 10, 2021

Conversation

howjmay
Copy link
Contributor

@howjmay howjmay commented May 3, 2021

Add SIMD operations for comparing maximum and minimum values.
npyv_[max|min]_u64 is not implemented in this PR, since AVX2 has some problems on implementing them.

@howjmay howjmay force-pushed the simd-min-max-integer branch 12 times, most recently from 0f0bbf9 to b3ea1c0 Compare May 3, 2021 11:52
@howjmay howjmay marked this pull request as ready for review May 3, 2021 11:53
@seiko2plus seiko2plus added the component: SIMD Issues in SIMD (fast instruction sets) code or machinery label May 3, 2021
@seiko2plus
Copy link
Member

@howjmay, Could you please add a testing case for integer min/max?

@howjmay
Copy link
Contributor Author

howjmay commented May 6, 2021

@seiko2plus Is there anything I should fix or add?

Copy link
Member

@seiko2plus seiko2plus left a comment

Choose a reason for hiding this comment

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

The current testing case only tests f32/f64, you have to add a new test case for integer max/min at the tail of the following class

class _SIMD_INT(_Test_Utility):
"""
To test all integer vector types at once
"""

numpy/core/src/common/simd/avx2/math.h Outdated Show resolved Hide resolved
numpy/core/src/common/simd/avx2/math.h Outdated Show resolved Hide resolved
@howjmay howjmay force-pushed the simd-min-max-integer branch 3 times, most recently from 22b1331 to d8ae6e0 Compare May 9, 2021 06:25
@howjmay howjmay requested a review from seiko2plus May 9, 2021 07:14
Copy link
Member

@seiko2plus seiko2plus left a comment

Choose a reason for hiding this comment

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

fix unit test cases

numpy/core/tests/test_simd.py Outdated Show resolved Hide resolved
Copy link
Member

@seiko2plus seiko2plus left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you.

@howjmay
Copy link
Contributor Author

howjmay commented May 10, 2021

LGTM, Thank you.

Thank you so much for helping

@charris charris merged commit 7c4b248 into numpy:main May 10, 2021
@charris
Copy link
Member

charris commented May 10, 2021

Thanks @howjmay .

@howjmay howjmay deleted the simd-min-max-integer branch May 10, 2021 22:58
@howjmay howjmay restored the simd-min-max-integer branch May 10, 2021 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 - Enhancement component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants