Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

nvexec: `when_all` followed by `continues_on` does not compile

オープン
#1,736 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp, docker

調査の方向性

提供された Dockerfile と clang-21 コマンドで失敗を再現し、when_all パスを動作する transfer_when_all の例と比較します。まず nvexec/stream/schedule_from.cuh と nvexec/stream_context.cuh から始めます。when_all に続いて continues_on を使用する例が正常にコンパイルできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

It seems that the customization of the "combo" when_all/continues_on is broken for nvexec . But transfer_when_all is fine though.

I think that using when_all, followed by continues_on is legal. Please correct me if I am wrong.

I'm using clang-21 and 3363435259b7ffae43d3f2e5f6b7a7b36d7cd7d3. See reproducer below.

To compile the transfer_when_all example, use the following command:

docker buildx build --progress=plain --target=transfer-when-all --tag=test - < dockerfile && docker run --rm -it --privileged test

It compiles and runs just fine.

To get the compile error with continues_on, use the following command:

docker buildx build --progress=plain --target=when-all --tag=test - < dockerfile

It leads to:

In file included from /stdexec/include/nvexec/stream_context.cuh:28:
#12 3.935 /stdexec/include/nvexec/stream/schedule_from.cuh:184:21: error: static assertion failed
#12 3.935   184 |       static_assert(stream_completing_sender<Sender, Env>);

It feels like the schedule_from is expecting when_all to have a completion scheduler, which is wrong ? Not sure though.

FROM nvidia/cuda:12.8.1-devel-ubuntu24.04 AS base

RUN apt update
RUN apt --yes --no-install-recommends install git wget lsb-release gpg software-properties-common

ARG CLANG_VERSION=21

RUN <<EOF
    set -ex

    wget https://apt.llvm.org/llvm.sh
    chmod +x llvm.sh
    ./llvm.sh ${CLANG_VERSION}
    rm llvm.sh

    apt --yes --no-install-recommends install clang-21
EOF

RUN git clone --branch=main https://github.com/NVIDIA/stdexec
RUN cd stdexec && git checkout 3363435259b7ffae43d3f2e5f6b7a7b36d7cd7d3

FROM base AS when-all

COPY <<EOF test_when_all.cpp
#include "nvexec/stream_context.cuh"

int main()
{
    ::nvexec::stream_context stream_ctx{};

    ::stdexec::scheduler auto sch = stream_ctx.get_scheduler();

    auto fork = stdexec::schedule(sch) | stdexec::then([]{printf("Hi from 'then' 0.\n");}) | stdexec::split();

    auto snd = stdexec::when_all(
        fork | stdexec::bulk(::stdexec::par, 4, [](const auto item){printf("Hi from 'bulk' 1, item %d.\n", item);}),
        fork | stdexec::then(                   []{printf("Hi from 'then' 2.\n");}),
        fork | stdexec::bulk(::stdexec::par, 4, [](const auto item){printf("Hi from 'bulk' 3, item %d.\n", item);}))
             | stdexec::continues_on(sch)
             | stdexec::then(                   []{printf("Hi.\n");});
    stdexec::sync_wait(std::move(snd));
}
EOF

RUN clang++-${CLANG_VERSION} -x cuda --cuda-gpu-arch=sm_86 -std=c++20 -I/stdexec/include -I/usr/local/cuda/include/ test_when_all.cpp

FROM base AS transfer-when-all

COPY <<EOF test_transfer_when_all.cpp
#include "nvexec/stream_context.cuh"

int main()
{
    ::nvexec::stream_context stream_ctx{};

    ::stdexec::scheduler auto sch = stream_ctx.get_scheduler();

    auto fork = stdexec::schedule(sch) | stdexec::then([]{printf("Hi from 'then' 0.\\n");}) | stdexec::split();

    auto snd = stdexec::transfer_when_all(sch,
        fork | stdexec::bulk(::stdexec::par, 4, [](const auto item){printf("Hi from 'bulk' 1, item %d.\\n", item);}),
        fork | stdexec::then(                   []{printf("Hi from 'then' 2.\\n");}),
        fork | stdexec::bulk(::stdexec::par, 4, [](const auto item){printf("Hi from 'bulk' 3, item %d.\\n", item);}))
             | stdexec::then(                   []{printf("Hi from 'then' 4.\\n");});
    stdexec::sync_wait(std::move(snd));
}
EOF

RUN <<EOF
    set -ex

    clang++-${CLANG_VERSION} -x cuda --cuda-gpu-arch=sm_86 -std=c++20 \
        -I/stdexec/include \
        -I/usr/local/cuda/include/ \
        -L/usr/local/cuda/lib64 -lcudart \
        test_transfer_when_all.cpp
EOF

CMD ./a.out
主要言語
C++
スター
2.4k
フォーク
274
平均マージ
1日 18時間
マージ済み PR(30日)
39

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/stdexec のほかの issue

NVIDIA/stdexec の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。