main doesn't compile with nvcc 13.0 (Linux, GCC 12/13 host): __connect_declfn_v, __transform_completion_signatures, __receiver_adaptor

Aberta
#2,403 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
18/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
cpp
Domínio
build-system

Direção de pesquisa

The failures come from headers in include/stdexec/__detail: __connect.hpp around lines 77-110, __receiver_adaptor.hpp line 125, __transform_completion_signatures.hpp lines 360 and 400, and __typeinfo.hpp line 101. Reproduce by compiling the nvcc_basic.cu snippet with nvcc 13.0 and the flags in the issue. Done means that snippet compiles and the new CI job passes, which needs maintainer agreement on supporting nvcc first.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

At current main (1d58877ad898fa3422658d47b28f67deb9c10e80), nvcc can't compile a basic sender chain in a .cu file. Tested in nvidia/cuda:13.0.0-devel-ubuntu24.04 with nvcc V13.0.48 and GCC 13.3 (default) or GCC 12.4 (-ccbin g++-12) as host compiler; both give the same errors. Related: #2402 (nvcc with an MSVC host, which has additional problems).

// nvcc_basic.cu
#include <stdexec/execution.hpp>

int main()
{
    auto s = stdexec::just(41) | stdexec::then([](int i) { return i + 1; });
    auto [v] = stdexec::sync_wait(std::move(s)).value();
    return v == 42 ? 0 : 1;
}
nvcc -std=c++20 --extended-lambda --expt-relaxed-constexpr -arch=sm_89 -I stdexec/include nvcc_basic.cu

Errors (paths shortened, repeated lines removed):

include/stdexec/__detail/__connect.hpp(83): error: declaration is incompatible with variable template "stdexec::__connect::__connect_declfn_v" (declared at line 77)
include/stdexec/__detail/__connect.hpp(90): error: declaration is incompatible with variable template "stdexec::__connect::__connect_declfn_v" (declared at line 77)
include/stdexec/__detail/__connect.hpp(103): error: declaration is incompatible with variable template "stdexec::__connect::__connect_declfn_v" (declared at line 97)
include/stdexec/__detail/__connect.hpp(110): error: declaration is incompatible with variable template "stdexec::__connect::__connect_declfn_v" (declared at line 97)
include/stdexec/__detail/__receiver_adaptor.hpp(125): error: expected a ">"
include/stdexec/__detail/__receiver_adaptor.hpp(125): error: too few arguments for concept template "std::derived_from"
include/stdexec/__detail/__receiver_adaptor.hpp(125): error: qualified name is not allowed
include/stdexec/__detail/__typeinfo.hpp(101): error: static assertion failed
include/stdexec/__detail/__transform_completion_signatures.hpp(360): error: type name is not allowed
include/stdexec/__detail/__transform_completion_signatures.hpp(400): error: type name is not allowed
include/stdexec/__detail/__sync_wait.hpp(353): error: no instance of function template "stdexec::connect_t::operator()" matches the argument list
include/stdexec/__detail/__sync_wait.hpp(355): error: static assertion failed with "..."

As far as I can see, the CI doesn't build anything with nvcc: the GPU jobs use clang and nvc++, the CPU jobs don't compile CUDA. That would explain why this goes unnoticed.

HPX compiles stdexec in .cu files and has been carrying patches for nvcc (https://github.com/TheHPXProject/hpx/tree/master/cmake, HPX_StdexecNvcc*.patch). Against 04de75de58, the revision HPX uses today, the patched stdexec compiles this program with nvcc 13.0. The largest patch (HPX_StdexecNvccWorkarounds.patch, which changes __connect.hpp, __receiver_adaptor.hpp, __transform_completion_signatures.hpp, __typeinfo.hpp, __env.hpp and __counting_scopes.hpp) no longer applies to main, and with the three HPX patches that still apply (AsyncScopeNvcc, which is #2304, CudaStdAtomic and NvccDiagnostics) main still fails with the errors above.

Is nvcc meant to be supported? If yes, would you take a CI job with nvcc (for example nvcc 13 with GCC 13 as host compiler, compiling the tests as CUDA sources) and PRs that bring HPX's workarounds to main? We'd be happy to help with those.

Linguagem predominante
C++
Estrelas
2.5k
Forks
285
Merge médio
2d 5h
PRs com merge (30d)
81

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de NVIDIA/stdexec

Todas as issues de NVIDIA/stdexec

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.