simlock
병렬 코딩 에이전트가 동일 시뮬레이터를 놓고 충돌하지 않도록 제어 평면 제공
std::execution은 비동기 및 병렬 프로그래밍을 위한 표준 C++ 프레임워크입니다
`std::execution`, the standard C++ framework for asynchronous and parallel programming.
개발 도구C++ · CudaGitHub @NVIDIA직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
설치형 프로젝트는 배포 도메인 없이도 확인할 수 있습니다. 개인 저장소는 GitHub 로그인으로, 조직 저장소는 위의 저장소 확인 파일로 직접 확인해 주세요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗A reference implementation of std::execution ([exec]), the C++26 model for asynchronous and parallel programming.
stdexec lets you express asynchronous work as composable, lazy sender pipelines that can run on threads, thread pools, GPUs, or any custom execution context — with structured concurrency guarantees.
[!WARNING]
stdexecis experimental and tracks an evolving standard. APIs may change without notice. NVIDIA does not guarantee fitness for any particular purpose.
Run three pieces of work concurrently on the system thread pool. Try it live on godbolt.
#include <stdexec/execution.hpp>
#include <cstdio>
namespace ex = stdexec;
int main() {
auto sched = ex::get_parallel_scheduler();
auto fun = [](int i) { return i * i; };
// Build a lazy pipeline: three squares, computed in parallel.
auto work = ex::when_all(ex::on(sched, ex::just(0) | ex::then(fun)),
ex::on(sched, ex::just(1) | ex::then(fun)),
ex::on(sched, ex::just(2) | ex::then(fun)));
// Launch the work and wait for the result.
auto [i, j, k] = ex::sync_wait(std::move(work)).value();
std::printf("%d %d %d\n", i, j, k); // prints "0 1 4"
}
get_parallel_scheduler() needs its backend compiled in, so either define STDEXEC_PARALLEL_SCHEDULER_HEADER_ONLY for your target (as the godbolt link does), or configure stdexec with -DSTDEXEC_BUILD_PARALLEL_SCHEDULER=ON and link STDEXEC::parallel_scheduler. Without either, the program can still link and then crash on that call.
std::execution (P2300).then, let_value, when_all, bulk, split, transfer, upon_*, ...async_scope, task, finally, when_any, repeat_n, ...io_uring context, NVIDIA GPU contexts, your own.nvexec schedulers (nvc++ compiler).<exec/...>) for primitives not (yet) in the standard.| Compiler | Minimum version | Notes |
|---|---|---|
| GCC | 12 | |
| Clang | 16 | |
| MSVC | 14.43 | |
| Xcode (Apple Clang) | 16 | |
| nvc++ | 26.5 | required for GPU support |
Requires -std=c++20 or later.
[!NOTE]
stdexecdoes not yet support NVIDIA'snvcccompiler.
Pick whichever fits your project.
CPM fetches and configures stdexec automatically from your CMakeLists.txt:
CPMAddPackage(
NAME stdexec
GITHUB_REPOSITORY NVIDIA/stdexec
GIT_TAG main # or a specific tag
)
target_link_libraries(my_target PRIVATE STDEXEC::stdexec)
add_subdirectoryClone alongside your project and add it as a subdirectory:
git clone https://github.com/NVIDIA/stdexec.git
add_subdirectory(stdexec)
target_link_libraries(my_target PRIVATE STDEXEC::stdexec)
A conanfile.py is provided for use with the Conan package manager.
Starting with NVHPC SDK 22.11, stdexec is bundled with nvc++. Pass --experimental-stdpar to put stdexec headers on the include path. Add -stdpar=gpu for GPU features. See the godbolt example.
stdexec is header-only, so adding -I<stdexec root>/include to your compile command is sufficient. Using the CMake target is recommended because it sets the required compile flags.
A minimal CMakeLists.txt using CPM:
cmake_minimum_required(VERSION 3.25.0)
project(stdexec_example LANGUAGES CXX)
include(CPM.cmake) # see https://github.com/cpm-cmake/CPM.cmake#adding-cpm
CPMAddPackage(
NAME stdexec
GITHUB_REPOSITORY NVIDIA/stdexec
GIT_TAG main
)
add_executable(example example.cpp)
target_link_libraries(example PRIVATE STDEXEC::stdexec)
stdexec ships GPU schedulers in <nvexec/...> for use with nvc++ -stdpar=gpu:
| Scheduler | Header | Description |
|---|---|---|
nvexec::stream_scheduler | <nvexec/stream_context.cuh> | Single-GPU scheduler (device 0). |
nvexec::multi_gpu_stream_scheduler | <nvexec/multi_gpu_context.cuh> | Multi-GPU scheduler across all visible devices. |
Live example: https://godbolt.org/z/h7rh5qGhj
The examples/ directory contains runnable programs demonstrating the library.
| Example | What it shows |
|---|---|
hello_world.cpp | The "hello world" of senders. |
hello_coro.cpp | Awaiting a sender from a coroutine. |
then.cpp | Writing a then algorithm from scratch. |
retry.cpp | Writing a retry algorithm from scratch. |
scope.cpp | Structured concurrency with async_scope. |
io_uring.cpp | Async I/O via the Linux io_uring context. |
sudoku.cpp | A parallel sudoku solver. |
server_theme/ | Server-style patterns (let_value, split, bulk, transfer). |
nvexec/ | GPU schedulers, including the Maxwell solver. |
📖 Full documentation: https://nvidia.github.io/stdexec
docs/CONTRIBUTING-docs.md[exec] — std::executionThe library is organized into three namespaces:
| Namespace | Headers | Contents |
|---|---|---|
::stdexec | <stdexec/...> | Things in (or proposed for) the C++ standard. |
::exec | <exec/...> | Generic additions and extensions. |
::nvexec | <nvexec/...> | NVIDIA-specific schedulers and customizations. |
The library itself is header-only — these steps are only needed if you want to build the test suite or the examples.
cmake -S . -B build -G Ninja
cmake --build build
ctest --test-dir build
To select a specific compiler:
cmake -S . -B build/clang -DCMAKE_CXX_COMPILER=$(which clang++)
cmake --build build/clang
To use libc++ with Clang:
cmake -S . -B build/libcxx \
-DCMAKE_CXX_COMPILER=$(which clang++) \
-DCMAKE_CXX_FLAGS=-stdlib=libc++
cmake --build build/libcxx
A VSCode extension is available that colorizes compiler diagnostics from stdexec, making the long template error messages much easier to read. Source and configuration: https://github.com/ericniebler/buildoutputcolorizer.
std::execution — the proposal accepted into C++26.io_uring.Contributions are welcome. Before opening a PR, please review:
CODE_OF_CONDUCT.mdMAINTAINERS.mddocs/CONTRIBUTING-docs.md for documentation contributions.Bug reports and feature requests belong in GitHub Issues; design discussion in GitHub Discussions.
If you reference stdexec in academic work, please cite the standards proposal:
@techreport{P2300,
author = {Niebler, Eric and Shoop, Kirk and Baker, Lewis and Dominiak, Michał and
Evtushenko, Georgy and Teodorescu, Lucian Radu and Howes, Lee and Garland,
Michael and Lelbach, Bryce Adelstein}
title = {{P2300R10}: \texttt{std::execution}},
institution = {ISO/IEC JTC1/SC22/WG21},
year = {2024},
url = {https://wg21.link/p2300}
}
stdexec is licensed under the Apache License 2.0 with LLVM Exceptions. See LICENSE.txt for the full text.