kokkos-execution 0.0.1
Loading...
Searching...
No Matches
domain.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_EXECUTION_SPACE_DOMAIN_HPP
2#define KOKKOS_EXECUTION_EXECUTION_SPACE_DOMAIN_HPP
3
5
6#if defined(KOKKOS_EXECUTION_ENABLE_DEBUG_LOGGING)
7# include "plog/Log.h"
8#endif
9
11
13
14struct Domain : public stdexec::default_domain {
15 template <typename Tag, stdexec::sender Sndr, typename... Args>
16 requires stdexec::__callable<ApplySenderFor<Tag>, Sndr, Args...>
17 static auto apply_sender(Tag, Sndr&& sndr, Args&&... args) {
18#if defined(KOKKOS_EXECUTION_ENABLE_DEBUG_LOGGING)
19 PLOG_DEBUG << Kokkos::Impl::TypeInfo<Domain>::name() << ": apply_sender for tag "
20 << Kokkos::Impl::TypeInfo<Tag>::name();
21#endif
22 return ApplySenderFor<Tag>{}(std::forward<Sndr>(sndr), std::forward<Args>(args)...);
23 }
24
25 template <stdexec::sender Sndr, typename Env>
26 requires stdexec::__applicable<TransformSenderFor<stdexec::tag_of_t<Sndr>>, Sndr&&, const Env&>
27 static auto transform_sender(stdexec::set_value_t, Sndr&& sndr, const Env& env)
28 noexcept(stdexec::__nothrow_applicable<TransformSenderFor<stdexec::tag_of_t<Sndr>>, Sndr&&, const Env&>) {
29#if defined(KOKKOS_EXECUTION_ENABLE_DEBUG_LOGGING)
30 PLOG_DEBUG << Kokkos::Impl::TypeInfo<Domain>::name() << ": transform_sender for tag "
31 << Kokkos::Impl::TypeInfo<stdexec::tag_of_t<Sndr>>::name();
32#endif
33 return stdexec::__apply(TransformSenderFor<stdexec::tag_of_t<Sndr>>{}, std::forward<Sndr>(sndr), env);
34 }
35};
36
37} // namespace Kokkos::Execution::ExecutionSpaceImpl
38
39#endif // KOKKOS_EXECUTION_EXECUTION_SPACE_DOMAIN_HPP
static auto apply_sender(Tag, Sndr &&sndr, Args &&... args)
Definition domain.hpp:17
static auto transform_sender(stdexec::set_value_t, Sndr &&sndr, const Env &env) noexcept(stdexec::__nothrow_applicable< TransformSenderFor< stdexec::tag_of_t< Sndr > >, Sndr &&, const Env & >)
Definition domain.hpp:27