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