pika-org / pika

pika builds on C++ std::execution with fiber, CUDA, HIP, and MPI support.
https://pikacpp.org
Boost Software License 1.0
61 stars 10 forks source link

Ensure `thread_pool_scheduler` annotations work with stdexec #681

Open msimberg opened 1 year ago

msimberg commented 1 year ago

We currently disable the schedule_from customization for thread_pool_scheduler with stdexec: https://github.com/pika-org/pika/blob/cb8ebe0667c903cd3155201b2a356f0e15b19855/libs/pika/executors/include/pika/executors/thread_pool_scheduler.hpp#L269-L287. We should make sure the customization is used even with stdexec enabled. In the case of this example, transfer should inherit of the scoped_annotation if no annotation is set on the scheduler (pseudo code):

scoped_annotation annotation("annotation");
auto s = schedule(sched) | then() | transfer(sched) | then();
msimberg commented 11 months ago

It may be possible to dispatch to the default implementation using the new transform_sender mechanism in stdexec (https://ericniebler.github.io/wg21/D2999R1.html). The process would look like this:

The transition in stdexec is not fully complete, so we may have to wait a bit before trying it out.