Skip to content

Require C++20#2410

Merged
rapids-bot[bot] merged 6 commits into
rapidsai:mainfrom
bdice:require-cxx20
Jul 2, 2026
Merged

Require C++20#2410
rapids-bot[bot] merged 6 commits into
rapidsai:mainfrom
bdice:require-cxx20

Conversation

@bdice

@bdice bdice commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Description

This updates the RMM library target and basic example to require C++20.

Closes #2034

Checklist

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

@copy-pr-bot

copy-pr-bot Bot commented May 19, 2026

Copy link
Copy Markdown

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

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR updates build, formatting, and test helper code to use C++20-oriented configuration and formatting.

Changes

C++20 Standard Upgrade

Layer / File(s) Summary
C++20 standard requirement updates
cpp/CMakeLists.txt, cpp/examples/basic/CMakeLists.txt, .clang-format
rmm sets CXX_STANDARD to 20, basic_example requires cxx_std_20, and .clang-format uses Standard: c++20.
DeviceScalarTest signature formatting
cpp/tests/device_scalar_tests.cpp
DeviceScalarTest::random_value() overload signatures and requires constraints are reformatted without changing the underlying logic.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • rapidsai/rmm#2413 — Touches cpp/tests/device_scalar_tests.cpp with related C++20-style requires and signature updates.

Suggested reviewers: wence-, shrshi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and directly summarizes the main change to require C++20.
Description check ✅ Passed The description accurately states that RMM and the basic example now require C++20.
Linked Issues check ✅ Passed The PR updates the RMM target and basic example to C++20, satisfying the linked requirement.
Out of Scope Changes check ✅ Passed The remaining edits are C++20-related configuration and formatting changes, with no unrelated functionality added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@bdice bdice added breaking Breaking change improvement Improvement / enhancement to an existing function labels May 20, 2026
@bdice bdice self-assigned this May 20, 2026
@bdice bdice moved this to In Progress in RMM Project Board May 20, 2026
@bdice bdice marked this pull request as ready for review May 20, 2026 23:19
@bdice bdice requested a review from a team as a code owner May 20, 2026 23:19
@bdice bdice requested a review from lamarrr May 20, 2026 23:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cpp/CMakeLists.txt (1)

133-141: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Propagate the C++20 requirement to downstream consumers.

The rmm target sets CXX_STANDARD 20 for its own compilation, but this property does not propagate to consumers linking against rmm::rmm. To ensure downstream projects inherit the C++20 requirement, add target_compile_features(rmm PUBLIC cxx_std_20) after the set_target_properties() call.

Suggested patch
 set_target_properties(
   rmm
   PROPERTIES BUILD_RPATH "\$ORIGIN"
              INSTALL_RPATH "\$ORIGIN"
              CXX_STANDARD 20
              CXX_STANDARD_REQUIRED ON
              CXX_VISIBILITY_PRESET hidden
              POSITION_INDEPENDENT_CODE ON
              INTERFACE_POSITION_INDEPENDENT_CODE ON)
+
+target_compile_features(rmm PUBLIC cxx_std_20)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/CMakeLists.txt` around lines 133 - 141, The rmm target sets its own
CXX_STANDARD but doesn't propagate C++20 to consumers; add a call to
target_compile_features for the rmm target to export the requirement (i.e., call
target_compile_features(rmm PUBLIC cxx_std_20)) immediately after the
set_target_properties(...) block so downstream targets linking to rmm::rmm
inherit the C++20 requirement.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@cpp/CMakeLists.txt`:
- Around line 133-141: The rmm target sets its own CXX_STANDARD but doesn't
propagate C++20 to consumers; add a call to target_compile_features for the rmm
target to export the requirement (i.e., call target_compile_features(rmm PUBLIC
cxx_std_20)) immediately after the set_target_properties(...) block so
downstream targets linking to rmm::rmm inherit the C++20 requirement.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7412acc7-d45b-44ca-b3d0-c56a634e7251

📥 Commits

Reviewing files that changed from the base of the PR and between f0f416a and 045de9b.

📒 Files selected for processing (2)
  • cpp/CMakeLists.txt
  • cpp/examples/basic/CMakeLists.txt

@lamarrr lamarrr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for working on this!

@bdice bdice mentioned this pull request Jun 3, 2026
3 tasks
@bdice bdice requested a review from a team as a code owner July 2, 2026 00:18
@bdice bdice requested review from davidwendt and harrism July 2, 2026 00:18
@bdice

bdice commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

/merge

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

Labels

breaking Breaking change improvement Improvement / enhancement to an existing function

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEA] Require C++20

3 participants