std::execution::transfer

From cppreference.com
< cpp
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
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.

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