Skip to content

Commit 752cefb

Browse files
author
Shivansh Singh
committed
executors: Replace tag_invoke(bulk_t) with member function on executor_scheduler
Refactor the P2300 bulk customization point from a deprecated tag_invoke free function to a member function on executor_scheduler, matching the modern P2300 sender/receiver specification. - Add bulk() member declaration in executor_scheduler (executor_scheduler.hpp) - Define bulk() out-of-line in executor_scheduler_bulk.hpp after executor_bulk_sender is fully defined - Remove the tag_invoke(bulk_t, executor_scheduler, ...) free function Signed-off-by: Shivansh Singh <your_github_email@example.com>
1 parent e172e8f commit 752cefb

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

libs/core/executors/include/hpx/executors/executor_scheduler.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,10 @@ namespace hpx::execution::experimental {
199199
{
200200
return {HPX_MOVE(exec_)};
201201
}
202+
203+
// P2300 bulk customization -- defined out-of-line in
204+
// executor_scheduler_bulk.hpp after executor_bulk_sender is available.
205+
template <typename Sender, typename Shape, typename F>
206+
auto bulk(Sender&& sender, Shape const& shape, F&& f) const;
202207
};
203208
} // namespace hpx::execution::experimental

libs/core/executors/include/hpx/executors/executor_scheduler_bulk.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,14 @@ namespace hpx::execution::experimental {
162162
};
163163
} // namespace detail
164164

165-
template <typename Executor, typename Sender, typename Shape, typename F>
166-
auto tag_invoke(bulk_t, executor_scheduler<Executor> const& sched,
167-
Sender&& sender, Shape const& shape, F&& f)
165+
// Out-of-line definition for executor_scheduler::bulk() member.
166+
template <typename Executor>
167+
template <typename Sender, typename Shape, typename F>
168+
auto executor_scheduler<Executor>::bulk(
169+
Sender&& sender, Shape const& shape, F&& f) const
168170
{
169171
return detail::executor_bulk_sender<Executor, std::decay_t<Sender>,
170172
Shape, std::decay_t<F>>{
171-
sched.exec_, HPX_FORWARD(Sender, sender), shape, HPX_FORWARD(F, f)};
173+
exec_, HPX_FORWARD(Sender, sender), shape, HPX_FORWARD(F, f)};
172174
}
173175
} // namespace hpx::execution::experimental

0 commit comments

Comments
 (0)