You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove load/store static assertion that prevents overaligned_flag_value < alignof(T),
i.e. a user can pass a value for the alignment that is less the alignment of the datatype itself, and the functionality is still valid.
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
📝 Summary
Summary by CodeRabbit
Bug Fixes
SIMD load and store operations now accept alignment flags that specify weaker alignment than the value type’s natural alignment. Runtime alignment checks remain in place. The behavior applies to masked and unmasked operations, including partial operations, across several common numeric types and vector widths.
The SIMD load/store alignment check no longer rejects alignment flags weaker than the element type’s natural alignment at compile time. A new test covers loads and stores with weaker flags across several scalar types, widths, masks, and partial counts.
Changes: SIMD Load/Store Alignment
Layer / File(s)
Summary
Allow and test weaker alignment flags libcudacxx/include/cuda/std/__simd/utility.h, libcudacxx/test/libcudacxx/std/numerics/simd/simd.loadstore/weaker_overalignment.pass.cpp
The compile-time assertion that required the flag alignment to meet the element type’s alignment is removed. The new host/device constexpr test checks unmasked, masked, and partial load/store operations with weaker alignment flags. It verifies values and boundary elements across several scalar types and widths.
Possibly related PRs
NVIDIA/cccl#12206: It concerns alignment computation used by SIMD load/store paths. This PR tests single alignment flags and does not cover the multi-flag behavior described for that PR.
Priority: ⬇️ Low
Change: Bug fix
Merge Risk:⚪ Minimal · up to 12a6d
Weaker alignment flags appear safe for naturally aligned pointers. No actionable issue remains before normal checks and merge.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
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
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.
Description
Remove
load/storestatic assertion that preventsoveraligned_flag_value < alignof(T),i.e. a user can pass a value for the alignment that is less the alignment of the datatype itself, and the functionality is still valid.