Skip to content

Commit 3587806

Browse files
committed
Fixes to account for stdexec #2124
Signed-off-by: Maarten Arnst <maarten.arnst@uliege.be>
1 parent 2ac095b commit 3587806

3 files changed

Lines changed: 13 additions & 27 deletions

File tree

external/stdexec

tests/execution_space/test_when_all.cpp

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,18 @@ TEST_F(WhenAllTest, single_branch) {
7070
Kokkos::Execution::ExecutionSpaceImpl::Domain
7171
>);
7272

73-
/// Even though the sender returned by @c stdexec::when_all is in the customized domain,
74-
/// it does not have a completion scheduler and so it is not an execution space completing sender.
75-
static_assert(!Kokkos::Execution::ExecutionSpaceImpl::execution_space_completing_sender<decltype(sndr)>);
73+
/// After the implementation of P4269R0 in https://github.com/NVIDIA/stdexec/pull/2124,
74+
/// when_all(s) with a single sender is expression-equivalent to auto(s).
75+
static_assert(std::same_as<stdexec::tag_of_t<decltype(sndr)>, stdexec::then_t>);
76+
static_assert(Kokkos::Execution::ExecutionSpaceImpl::execution_space_completing_sender<decltype(sndr)>);
7677

7778
ASSERT_EQ(data(), 0) << "Eager execution is not allowed.";
7879

79-
const auto recorded_events = Tests::Utils::record_sync_wait<recorder_listener_t>(std::move(sndr));
80-
81-
/// Because the sender returned by @c stdexec::when_all is not an execution space completing sender,
82-
/// the default implementation of @c stdexec::sync_wait is used.
83-
ASSERT_THAT(recorded_events, [&]() {
84-
if constexpr (Kokkos::Execution::Impl::has_non_blocking_dispatch<TEST_EXECUTION_SPACE>) {
85-
return testing::ElementsAre(
86-
MATCHER_FOR_BEGIN_PFOR(exec, dispatch_label(exec, "then")),
87-
MATCHER_FOR_RECORD_EVENT(exec),
88-
MATCHER_FOR_WAIT_EVENT(recorded_events.at(1)));
89-
} else {
90-
return testing::ElementsAre(
91-
MATCHER_FOR_BEGIN_PFOR(exec, dispatch_label(exec, "then")),
92-
MATCHER_FOR_BEGIN_FENCE(exec, dispatch_label(exec, "after dispatch")));
93-
}
94-
}());
80+
ASSERT_THAT(
81+
Tests::Utils::record_sync_wait<recorder_listener_t>(std::move(sndr)),
82+
testing::ElementsAre(
83+
MATCHER_FOR_BEGIN_PFOR(exec, dispatch_label(exec, "then")),
84+
MATCHER_FOR_BEGIN_FENCE(exec, dispatch_label(exec, "sync_wait"))));
9585

9686
ASSERT_EQ(data(), 1);
9787
}

tests/graph/test_when_all.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,9 @@ consteval bool test_sndr_nothrow_transformable() {
101101
static_assert(std::same_as<
102102
stdexec::__demangle_t<when_all_sndr_t>,
103103
Tests::Utils::basic_sender_t<
104-
stdexec::when_all_t,
105-
stdexec::__,
106-
Tests::Utils::basic_sender_t<
107-
stdexec::then_t,
108-
Tests::Utils::Functors::NoOp<false, false, false>,
109-
typename TEST_CATEGORY(WhenAllTest)::schedule_sender_t
110-
>
104+
stdexec::then_t,
105+
Tests::Utils::Functors::NoOp<false, false, false>,
106+
typename TEST_CATEGORY(WhenAllTest)::schedule_sender_t
111107
>
112108
>);
113109

0 commit comments

Comments
 (0)