kokkos-execution 0.0.1
Loading...
Searching...
No Matches
check_continues_on.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_TESTS_UTILS_CHECK_CONTINUES_ON_HPP
2#define KOKKOS_EXECUTION_TESTS_UTILS_CHECK_CONTINUES_ON_HPP
3
4#include <concepts>
5
7
9
10namespace Tests::Utils {
11
17template <stdexec::scheduler Schd>
18consteval bool check_continues_on() {
19 using sndr_t = decltype(stdexec::just() | stdexec::continues_on(std::declval<Schd>()));
20
22 static_assert(std::same_as<
23 stdexec::__demangle_t<sndr_t>,
25 stdexec::continues_on_t,
26 Schd,
28 stdexec::schedule_from_t,
29 stdexec::__,
31 >
32 >
33 >);
34
36 if constexpr (stdexec::sender_in<sndr_t>) {
37 stdexec::__diagnose_sender_concept_failure<sndr_t>();
38 } else {
39 stdexec::__diagnose_sender_concept_failure<sndr_t, stdexec::env<>>();
40 }
41
43 static_assert(std::same_as<stdexec::__domain_of_t<stdexec::env_of_t<sndr_t>>, stdexec::default_domain>);
44 static_assert(std::same_as<
45 stdexec::__detail::__completing_domain_t<stdexec::set_value_t, sndr_t>,
46 std::invoke_result_t<stdexec::get_completion_domain_t<stdexec::set_value_t>, Schd>
47 >);
48
50 if constexpr (stdexec::__minvocable_q<stdexec::__completion_scheduler_of_t, stdexec::set_value_t, sndr_t>) {
51 static_assert(std::same_as<stdexec::__completion_scheduler_of_t<stdexec::set_value_t, sndr_t>, Schd>);
53 } else {
54 static_assert(
55 std::same_as<stdexec::__completion_scheduler_of_t<stdexec::set_value_t, sndr_t, stdexec::env<>>, Schd>);
56 }
57
58 return true;
59}
60
61} // namespace Tests::Utils
62
63#endif // KOKKOS_EXECUTION_TESTS_UTILS_CHECK_CONTINUES_ON_HPP
typename stdexec::__basic_sender< Args... >::type basic_sender_t
See https://github.com/NVIDIA/stdexec/pull/1873#discussion_r2834863237.
Definition stdexec.hpp:10
consteval bool check_continues_on()
Check how the scheduler customizes stdexec::continues_on.