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 sndr_t,
26 stdexec::__sexpr<
27 stdexec::continues_on_t,
28 Schd,
29 stdexec::__sexpr<stdexec::schedule_from_t, stdexec::__, stdexec::just_t::__sender<>>
30 >
31 >);
32
34 if constexpr (stdexec::sender_in<sndr_t>) {
35 stdexec::__diagnose_sender_concept_failure<sndr_t>();
36 } else {
37 stdexec::__diagnose_sender_concept_failure<sndr_t, stdexec::env<>>();
38 }
39
41 static_assert(std::same_as<stdexec::__domain_of_t<stdexec::env_of_t<sndr_t>>, stdexec::default_domain>);
42 static_assert(std::same_as<
43 stdexec::__detail::__completing_domain_t<stdexec::set_value_t, sndr_t>,
44 std::invoke_result_t<stdexec::get_completion_domain_t<stdexec::set_value_t>, Schd>
45 >);
46
48 if constexpr (
49 stdexec::__minvocable_q<Kokkos::Execution::Impl::completion_scheduler_of_t, stdexec::set_value_t, sndr_t>) {
50 static_assert(
51 std::same_as<Kokkos::Execution::Impl::completion_scheduler_of_t<stdexec::set_value_t, sndr_t>, Schd>);
53 } else {
54 static_assert(stdexec::dependent_sender<sndr_t>);
55 static_assert(std::same_as<
57 Schd
58 >);
59 }
60
61 return true;
62}
63
64} // namespace Tests::Utils
65
66#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.
consteval bool check_continues_on()
Check how the scheduler customizes stdexec::continues_on.