Skip to content

Commit f4925c6

Browse files
author
Sai Charan
committed
few changes
1 parent 1f8b31b commit f4925c6

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

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

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ namespace hpx::execution::experimental {
100100
{
101101
static_assert(
102102
hpx::execution::experimental::stdexec_internal::__completes_on<
103-
Sender, thread_pool_policy_scheduler<Policy>>,
103+
Sender, thread_pool_policy_scheduler<Policy>,
104+
hpx::execution::experimental::env<>>,
104105
"No thread_pool_policy_scheduler instance can be found in the "
105106
"sender's "
106107
"attributes on which to schedule bulk work.");
@@ -458,6 +459,20 @@ namespace hpx::execution::experimental {
458459
struct env
459460
{
460461
std::decay_t<Scheduler> const& sched;
462+
463+
// query() member function for newer stdexec
464+
auto query(stdexec::get_domain_t) const noexcept
465+
{
466+
return stdexec::get_domain(sched);
467+
}
468+
469+
template <typename CPO>
470+
requires meta::value<meta::one_of<CPO, set_value_t, set_stopped_t>>
471+
auto query(hpx::execution::experimental::get_completion_scheduler_t<CPO>) const noexcept
472+
{
473+
return sched;
474+
}
475+
461476
// clang-format off
462477
template <typename CPO,
463478
HPX_CONCEPT_REQUIRES_(
@@ -512,7 +527,7 @@ namespace hpx::execution::experimental {
512527
hpx::execution::experimental::get_forward_progress_guarantee_t,
513528
thread_pool_policy_scheduler const& sched) noexcept
514529
{
515-
if (hpx::detail::has_async_policy(sched.policy()))
530+
if (hpx::has_async_policy(sched.policy()))
516531
{
517532
return hpx::execution::experimental::
518533
forward_progress_guarantee::parallel;
@@ -525,6 +540,12 @@ namespace hpx::execution::experimental {
525540
}
526541
#endif
527542

543+
// Direct schedule() member function for newer stdexec
544+
constexpr sender<thread_pool_policy_scheduler> schedule() const
545+
{
546+
return {*this};
547+
}
548+
528549
friend constexpr sender<thread_pool_policy_scheduler> tag_invoke(
529550
hpx::execution::experimental::schedule_t,
530551
thread_pool_policy_scheduler&& sched)
@@ -575,7 +596,7 @@ namespace hpx::execution::experimental {
575596
}
576597
else
577598
{
578-
if (policy_.get_policy() == hpx::detail::launch_policy::sync)
599+
if (policy_.get_policy() == hpx::launch_policy::sync)
579600
{
580601
return 1;
581602
}

0 commit comments

Comments
 (0)