kokkos-execution
0.0.1
Toggle main menu visibility
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
6
#include "
kokkos-execution/stdexec.hpp
"
7
8
#include "
kokkos-execution/impl/sender_introspection.hpp
"
9
10
#include "
tests/utils/stdexec.hpp
"
11
12
namespace
Tests::Utils
{
13
19
template
<stdexec::scheduler Schd>
20
consteval
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<
56
Kokkos::Execution::Impl::completion_scheduler_of_t<stdexec::set_value_t, sndr_t, stdexec::env<>
>,
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
stdexec.hpp
Kokkos::Execution::Impl::completion_scheduler_of_t
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.
Definition
sender_introspection.hpp:18
Tests::Utils
Definition
test_sync_wait.cpp:20
Tests::Utils::check_continues_on
consteval bool check_continues_on()
Check how the scheduler customizes stdexec::continues_on.
Definition
check_continues_on.hpp:20
sender_introspection.hpp
stdexec.hpp
tests
utils
check_continues_on.hpp
Generated on
for kokkos-execution by
1.18.0