Skip to content

Honor simulated memory resource alignment#2400

Merged
rapids-bot[bot] merged 2 commits into
rapidsai:mainfrom
bdice:pr-honor-simulated-mr-alignment
May 22, 2026
Merged

Honor simulated memory resource alignment#2400
rapids-bot[bot] merged 2 commits into
rapidsai:mainfrom
bdice:pr-honor-simulated-mr-alignment

Conversation

@bdice
Copy link
Copy Markdown
Collaborator

@bdice bdice commented May 17, 2026

Description

Updates simulated_memory_resource to validate requested alignment and align its simulated address cursor before returning allocations. This makes replay benchmark simulated allocations preserve alignment semantics.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@bdice bdice added bug Something isn't working non-breaking Non-breaking change labels May 17, 2026
@bdice bdice added the non-breaking Non-breaking change label May 17, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 17, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

The simulated_memory_resource::allocate(...) method now properly enforces memory alignment. It validates the alignment parameter as a non-zero power of two, aligns the allocation start address before allocating, performs bounds checking using the aligned address, and advances the internal pointer based on the aligned allocation size.

Changes

Alignment Handling in Memory Resource Allocation

Layer / File(s) Summary
Alignment enforcement in allocate(...)
cpp/benchmarks/utilities/simulated_memory_resource.hpp
Added <cstdint> header; refactored allocate(...) to validate alignment is a non-zero power of two, compute aligned start addresses from the current begin_ pointer, perform bounds checking against the aligned region, and update begin_ based on the aligned allocation size rather than the unaligned pointer.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • lamarrr
  • harrism
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically describes the main change: updating simulated_memory_resource to honor alignment requests in its allocate implementation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly describes the purpose and scope of the changes: honoring alignment in the simulated memory resource to preserve alignment semantics in replay benchmarks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@bdice bdice moved this to In Progress in RMM Project Board May 21, 2026
@bdice bdice self-assigned this May 21, 2026
@bdice bdice marked this pull request as ready for review May 21, 2026 21:53
@bdice bdice requested a review from a team as a code owner May 21, 2026 21:53
@bdice bdice requested review from lamarrr and rongou May 21, 2026 21:53
@bdice
Copy link
Copy Markdown
Collaborator Author

bdice commented May 22, 2026

/merge

@rapids-bot rapids-bot Bot merged commit 5fd6cee into rapidsai:main May 22, 2026
84 of 85 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in RMM Project Board May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants