Skip to content

[libcu++] Fix nvcc picking up hidden friends on windows - #10723

Open
davebayer wants to merge 1 commit into
NVIDIA:mainfrom
davebayer:constant_wrapper_constraints2
Open

[libcu++] Fix nvcc picking up hidden friends on windows#10723
davebayer wants to merge 1 commit into
NVIDIA:mainfrom
davebayer:constant_wrapper_constraints2

Conversation

@davebayer

@davebayer davebayer commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

#10687 silently broke main, because nvcc on windows seem to pick up hidden friends for other classes as well during host stubs generation. This PR fixes that problem by further constraining constant_wrapper's operators

@davebayer
davebayer requested a review from a team as a code owner August 8, 2026 04:48
@davebayer
davebayer requested a review from fbusato August 8, 2026 04:48
@davebayer
davebayer requested a review from a team as a code owner August 8, 2026 04:48
@davebayer
davebayer requested a review from jrhemstad August 8, 2026 04:48
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Aug 8, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2a22e5d3-bd79-4718-b6e3-9a83e59ca645

📥 Commits

Reviewing files that changed from the base of the PR and between 269cde9 and 4895477.

📒 Files selected for processing (1)
  • libcudacxx/include/cuda/std/__utility/constant_wrapper.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • libcudacxx/include/cuda/std/__utility/constant_wrapper.h

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved operator constraint handling for constant wrapper values.
    • Ensured supported binary operations require valid constexpr operands.
    • Preserved restrictions for logical operators while maintaining existing behavior for unaffected operations.

Walkthrough

Changes

The constant-wrapper implementation adds wrapper-type detection and applies wrapper-participation constraints across unary, mutator, binary, logical, comparison, comma, and pointer-to-member operators.

Constant-wrapper operator constraints

Layer / File(s) Summary
Wrapper detection and unary constraints
libcudacxx/include/cuda/std/__utility/constant_wrapper.h
Adds __is_cuda_std_constant_wrapper_v. Unary and increment/decrement overloads require wrapper operands and constexpr parameters.
Binary operator constraints
libcudacxx/include/cuda/std/__utility/constant_wrapper.h
Arithmetic, shift, bitwise, and logical-and overloads require wrapper participation. Binary operands remain constrained as constexpr parameters, and the non-boolean restriction for && remains.
Comparison and special operator constraints
libcudacxx/include/cuda/std/__utility/constant_wrapper.h
Spaceship, relational comparison, comma, and pointer-to-member constraints require wrapper participation alongside existing constexpr requirements.

Possibly related PRs

  • NVIDIA/cccl#10687: Both changes update constant_wrapper.h operator detection and constraints.

Suggested reviewers: jrhemstad, fbusato


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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7b43098a-1f59-4289-b478-64af3ff9ef5a

📥 Commits

Reviewing files that changed from the base of the PR and between 8b0b7eb and 269cde9.

📒 Files selected for processing (3)
  • ci/matrix.yaml
  • libcudacxx/include/cuda/__execution/output_ordering.h
  • libcudacxx/include/cuda/std/__utility/constant_wrapper.h

Comment thread ci/matrix.yaml Outdated
Comment thread libcudacxx/include/cuda/std/__utility/constant_wrapper.h
@github-actions

This comment has been minimized.

@davebayer
davebayer force-pushed the constant_wrapper_constraints2 branch from 269cde9 to 4895477 Compare August 8, 2026 06:01
@davebayer
davebayer removed request for a team and jrhemstad August 8, 2026 06:01
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

⏱️ CCCL compile-time benchmark comparison: Public headers compile-time bench

Result: 1 regression row(s), 5 improvement row(s) above threshold.

Run Value
Config public-headers-gcc13
Baseline origin/main
Preset all-dev
Targets cub.headers.base, thrust.cpp.cuda.headers.base, libcudacxx.test.public_headers
GPU / launch args rtx2080 / --cuda 13.3 --host gcc13

Artifacts: reports and traces

TU total compilation

-f total-compilation inclusive --sort total

🟢 TU total compilation — Improvements
Rank Improvement impact Selected Δ Baseline Current Event Matched traces
1 4.223102 -4.223102 19.737656 15.514554 Total Compilation Time: cuda/execution 1

Direct file processing

-f file-processing exclusive --sort total

🔴 Direct file processing — Regressions
Rank Regression impact Selected Δ Baseline Current Event Matched traces
1 1.088121 1.088121 19.679740 20.767861 Processing Header File: libcudacxx/include/cuda/__device/physical_device.h 94
🟢 Direct file processing — Improvements
Rank Improvement impact Selected Δ Baseline Current Event Matched traces
1 1.149575 -1.149575 9.658821 8.509246 Processing Header File: libcudacxx/include/cuda/std/__cccl/prologue.h 550
2 0.530647 -0.530647 2.939147 2.408500 Processing Header File: libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated.h 57
3 0.283896 -0.283896 3.447467 3.163571 Processing Header File: libcudacxx/include/cuda/std/__cccl/epilogue.h 550
4 0.239656 -0.239656 11.033785 10.794129 Processing Header File: libcudacxx/include/cuda/std/__iterator/concepts.h 437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant