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

Offen
#2,403 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
18/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
cpp
Bereich
build-system

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
C++
Sterne
2.5k
Forks
285
Ø Merge
2 T. 5 Std.
Gemergte PRs (30 T.)
85

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus NVIDIA/stdexec

Alle Issues in NVIDIA/stdexec

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.