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
11
12namespace Tests::Utils {
13
19template <stdexec::scheduler Schd>
20consteval bool check_continues_on() {
21 using sndr_t = decltype(stdexec::just() | stdexec::continues_on(std::declval<Schd>()));
22
24 static_assert(std::same_as<
25 stdexec::__demangle_t<sndr_t>,
27 stdexec::continues_on_t,
28 Schd,
30 stdexec::schedule_from_t,
31 stdexec::__,
33 >
34 >
35 >);
36
38 if constexpr (stdexec::sender_in<sndr_t>) {
39 stdexec::__diagnose_sender_concept_failure<sndr_t>();
40 } else {
41 stdexec::__diagnose_sender_concept_failure<sndr_t, stdexec::env<>>();
42 }
43
45 static_assert(std::same_as<stdexec::__domain_of_t<stdexec::env_of_t<sndr_t>>, stdexec::default_domain>);
46 static_assert(std::same_as<
47 stdexec::__detail::__completing_domain_t<stdexec::set_value_t, sndr_t>,
48 std::invoke_result_t<stdexec::get_completion_domain_t<stdexec::set_value_t>, Schd>
49 >);
50
52 if constexpr (
53 stdexec::__minvocable_q<Kokkos::Execution::Impl::completion_scheduler_of_t, stdexec::set_value_t, sndr_t>) {
54 static_assert(
55 std::same_as<Kokkos::Execution::Impl::completion_scheduler_of_t<stdexec::set_value_t, sndr_t>, Schd>);
57 } else {
58 static_assert(stdexec::dependent_sender<sndr_t>);
59 static_assert(std::same_as<
61 Schd
62 >);
63 }
64
65 return true;
66}
67
68} // namespace Tests::Utils
69
70#endif // KOKKOS_EXECUTION_TESTS_UTILS_CHECK_CONTINUES_ON_HPP
std::invoke_result_t< stdexec::get_completion_scheduler_t< Tag >, stdexec::env_of_t< Sndr >, Env... > completion_scheduler_of_t
Retrieve the completion scheduler for a given completion tag.
typename stdexec::__basic_sender< Args... >::type basic_sender_t
See https://github.com/NVIDIA/stdexec/pull/1873#discussion_r2834863237.
Definition stdexec.hpp:12
consteval bool check_continues_on()
Check how the scheduler customizes stdexec::continues_on.