kokkos-execution 0.0.1
Loading...
Searching...
No Matches
completion_signatures.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_IMPL_COMPLETION_SIGNATURES_HPP
2#define KOKKOS_EXECUTION_IMPL_COMPLETION_SIGNATURES_HPP
3
5
7
17template <stdexec::sender Sndr, stdexec::__valid_completion_signatures ExtraSigs, typename... Env>
18consteval auto completion_signatures_add() {
19 using completions_t = stdexec::__completion_signatures_of_t<Sndr, Env...>;
20
21 if constexpr (stdexec::__sends<stdexec::set_value_t, Sndr, Env...>) {
22 return stdexec::__concat_completion_signatures(completions_t{}, ExtraSigs{});
23 } else {
24 return completions_t{};
25 }
26}
27
28template <stdexec::sender Sndr, stdexec::__valid_completion_signatures ExtraSigs, typename... Env>
29using completion_signatures_add_t = decltype(completion_signatures_add<Sndr, ExtraSigs, Env...>());
30
31// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
32#define KOKKOS_EXECUTION_COMPL_SIGS_ADD(_decayed_self_type_, _sndr_type_, ...) \
33 template <stdexec::__decays_to<_decayed_self_type_> Self, typename... Env> \
34 static consteval auto get_completion_signatures() { \
35 return Kokkos::Execution::Impl::completion_signatures_add< \
36 stdexec::__copy_cvref_t<Self, _sndr_type_>, \
37 stdexec::completion_signatures<__VA_ARGS__>, \
38 Env... \
39 >(); \
40 }
41
42// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
43#define KOKKOS_EXECUTION_COMPL_SIGS_KEEP(_decayed_self_type_, _sndr_type_) \
44 template <stdexec::__decays_to<_decayed_self_type_> Self, typename... Env> \
45 static consteval auto get_completion_signatures() { \
46 return stdexec::__completion_signatures_of_t<stdexec::__copy_cvref_t<Self, _sndr_type_>, Env...>{}; \
47 }
48
49} // namespace Kokkos::Execution::Impl
50
51#endif // KOKKOS_EXECUTION_IMPL_COMPLETION_SIGNATURES_HPP
consteval auto completion_signatures_add()
Concatenate Sndr completion signatures with ExtraSigs if Sndr sends on the value channel; otherwise r...
decltype(completion_signatures_add< Sndr, ExtraSigs, Env... >()) completion_signatures_add_t