std::execution::transfer(3)
β¨ NAME β¨
std::execution::transfer β std::execution::transfer (yes bestie, the NAME is literally the same thing twice and honestly? iconic π). This is from the C++ Standard Libary manual, section 3, and it's the page for the transfer sender adaptor. Receipts below, no cap π
.
π¦ Synopsis π¦
Defined in header <execution>
execution::sender auto transfer(
execution::sender auto input,
execution::scheduler auto scheduler
);
π Parameters π
inputβ sender to be transfered on the scheduler (spelling βtransferedβ kept exactly as the page says, bestie π).schedulerβ scheduler on which the sender will run.
π Return value π
Returns a sender describing the transition from the execution agent of the input sender to the execution agent of the target scheduler. That's the whole vibe: transition, sender, execution agents, target scheduler, periodt β¨.
π₯ Example π₯
Possible usage of execution::transfer.
execution::scheduler auto cpu_sched =
get_system_thread_pool().scheduler();
execution::scheduler auto gpu_sched = cuda::scheduler();
execution::sender auto cpu_task = execution::schedule(cpu_sched);
// cpu_task describes the creation of a new task on the system thread
pool
execution::sender auto gpu_task = execution::transfer(cpu_task,
gpu_sched);
// gpu_task describes the transition of the task graph described by
cpu_task to the GPU
β¨ cute lil sign-off β¨ source/version is http://cppreference.com, dated 2024.06.10 β that's the footer deets, now go slay some senders ππ¦π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms