SIMD: Portable Masks, C++20#4607
Merged
WeiqunZhang merged 1 commit intoAMReX-Codes:developmentfrom Aug 13, 2025
Merged
Conversation
Ensure we can use any producing type's `simd_mask`, e.g., `double`, when setting (in)valid particles, by manipulating our `uint64` in `idcpu`. This currently requires a conversion/cast in C++. Make this conversion portable, so far it only worked on GCC/Linux. This helper needs C++20. Thus, build AMReX conditionally always with C++20 or newer when SIMD is requested (non-default). Eventually, we will require C++26 once this becomes standard, and C++29 will have even more updates.
bad894e to
1ce4e62
Compare
ax3l
added a commit
to ax3l/amrex-feedstock
that referenced
this pull request
Aug 13, 2025
ax3l
added a commit
to ax3l/warpx
that referenced
this pull request
Aug 13, 2025
Will make development easier and is fully optional. See: AMReX-Codes/amrex#4607
ax3l
added a commit
to ax3l/impactx
that referenced
this pull request
Aug 13, 2025
WeiqunZhang
approved these changes
Aug 13, 2025
ax3l
added a commit
to BLAST-ImpactX/impactx
that referenced
this pull request
Aug 13, 2025
* SIMD: Portable Masks, C++20 See AMReX-Codes/amrex#4607 * Fix C++20 Warning ``` src/elements/QuadEdge.H:113:26: error: arithmetic between enumeration type ‘impactx::elements::QuadEdge::Location’ and floating-point type ‘amrex::ParticleReal’ {aka ‘double’} is deprecated [-Werror=deprecated-enum-float-conversion] ```
EZoni
pushed a commit
to BLAST-WarpX/warpx
that referenced
this pull request
Aug 19, 2025
ax3l
added a commit
that referenced
this pull request
Feb 7, 2026
## Summary Needed to cover SIMD features and generic SIMD/non-SIMD patterns. Bravely vibe coded, but now reviewed and improved for sensibility. ## Additional background #4924 #4607 #4600 #4520 ## Checklist The proposed changes: - [ ] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate --------- Co-authored-by: Weiqun Zhang <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ensure we can use any producing type's
simd_mask, e.g.,double, when setting (in)valid particles, by manipulating ouruint64inidcpu. This currently requires a conversion/cast in C++. Make this conversion portable, so far it only worked on GCC/Linux.This helper needs C++20. Thus, build AMReX conditionally always with C++20 or newer when SIMD is requested (non-default). Eventually, we will require C++26 once this becomes standard, and C++29 will have even more updates.
Additional background
Portability to macOS/Windows:
mask.__cvt()on macOS/Win? mattkretz/vir-simd#45Checklist
The proposed changes: