Skip to content

[libcu++] cuda::std::simd::load/store Allow overaligned_flag_value < alignof(T) - #12235

Merged
fbusato merged 1 commit into
NVIDIA:mainfrom
fbusato:simd-fix-part3
Oct 26, 2026
Merged

fbusato merged 1 commit into
NVIDIA:mainfrom
fbusato:simd-fix-part3

Conversation

@fbusato

@fbusato fbusato commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Description

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.

@fbusato fbusato self-assigned this Oct 23, 2026
@fbusato
fbusato requested a review from a team as a code owner October 23, 2026 23:19
@fbusato
fbusato requested a review from pciolkosz October 23, 2026 23:19
@fbusato fbusato added this to CCCL Oct 23, 2026
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Oct 23, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/cccl
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 053d3c7
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: a995a0e4-12be-4e6d-aec0-5312233abbd4
📥 Commits

Reviewing files that changed from the base of the PR and between 053d3c7 and 12a6da0.

📒 Files selected for processing: 2
  • libcudacxx/include/cuda/std/__simd/utility.h
  • libcudacxx/test/libcudacxx/std/numerics/simd/simd.loadstore/weaker_overalignment.pass.cpp
💤 Files with no reviewable changes: 1
  • libcudacxx/include/cuda/std/__simd/utility.h

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.

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 00m: Pass: 100%/228 | Total: 2d 18h | Max: 1h 19m | Hits: 85%/792460

See results here.

@fbusato
fbusato merged commit c6ebc09 into NVIDIA:main Oct 26, 2026
258 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants