Skip to content

fix(stdexec): skip inline_scheduler's static_assert under nvcc - #2288

Open
alwaysprince05 wants to merge 1 commit into
NVIDIA:mainfrom
alwaysprince05:fix/inline-scheduler-nvcc-assert
Open

alwaysprince05 wants to merge 1 commit into
NVIDIA:mainfrom
alwaysprince05:fix/inline-scheduler-nvcc-assert

Conversation

@alwaysprince05

Copy link
Copy Markdown
Contributor

Problem

Including <stdexec/execution.hpp> fails to compile under nvcc (#2284):

error: 'struct stdexec::inline_scheduler::__sender' is private within this context

The namespace-scope static_assert at the bottom of __inline_scheduler.hpp names the
private nested __sender type via schedule_result_t<inline_scheduler>, and nvcc's
parse-time evaluation doesn't see through the access the way host compilers do.

Fix

Guard the assert with #if !defined(__CUDACC__), as suggested in #2284. The check
is a compile-time sanity check with no runtime effect; host compilers see no change.
I used the raw macro rather than STDEXEC_CUDA_COMPILATION() to keep the guard as
narrow as the reported failure — happy to switch if the wider macro is preferred.

fixes #2284

Verification

  • Preprocessor check: the assert is present in host compilation and absent when
    CUDACC is defined.
  • test.stdexec + test.exec rebuilt and pass: 100% of 993 tests, in both the normal
    build and with STDEXEC_ENABLE_EXTRA_TYPE_CHECKING=ON.
  • Minimal repro compiles clean with -Wall -Wextra -Werror on Apple Clang 21.
  • clang-format --dry-run --Werror passes on the touched file.
  • No nvcc on my machine, so the nvcc compile itself still needs a run on a CUDA
    toolchain (CI or a reviewer).

@copy-pr-bot

copy-pr-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@alwaysprince05

Copy link
Copy Markdown
Contributor Author

/ok to test

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inline_scheduler's namespace-scope static_assert fails under nvcc (private nested __sender access)

1 participant