kokkos-utils 0.0.4
 
Loading...
Searching...
No Matches
Listener.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_UTILS_CALLBACKS_LISTENER_HPP
2#define KOKKOS_UTILS_CALLBACKS_LISTENER_HPP
3
5
7{
8
9namespace impl
10{
11
17template <typename Callable>
19{
20 template <Event EventType>
21 using type = std::is_invocable_r<void, Callable, const EventType&>;
22};
23
24template <typename T>
25concept has_event_type_list = requires { typename T::event_type_list_t; };
26
27template <typename Callable>
29{
30 using type = Kokkos::Impl::filter_type_list_t<
32};
33
34template <has_event_type_list Callable>
35struct ListenerEventTypeList<Callable>
36{
37 using type = typename Callable::event_type_list_t;
38};
39
44template <typename Callable>
46
51template <typename Callable>
55 typename Callable::event_type_list_t
56 >;
57} // namespace impl
58
63template <typename Callable>
65
67template <typename Callable, typename... EventTypes>
69
71template <typename Callable>
73
74} // namespace Kokkos::utils::callbacks
75
76#endif // KOKKOS_UTILS_CALLBACKS_LISTENER_HPP
Check that Callable is a listener for each event in EventTypes.
Definition Listener.hpp:68
typename impl::ListenerEventTypeList< Callable >::type listener_event_type_list_t
Type list holding the event types that Callable can be a listener for.
Definition Listener.hpp:72
Kokkos::Impl::type_list< BeginParallelForEvent, EndParallelForEvent, BeginParallelReduceEvent, EndParallelReduceEvent, BeginParallelScanEvent, EndParallelScanEvent, BeginFenceEvent, EndFenceEvent, AllocateDataEvent, DeallocateDataEvent, BeginDeepCopyEvent, EndDeepCopyEvent, CreateProfileSectionEvent, DestroyProfileSectionEvent, StartProfileSectionEvent, StopProfileSectionEvent, PushRegionEvent, PopRegionEvent, ProfileEvent > EventTypeList
Type list holding all event types.
Definition Events.hpp:206
constexpr bool type_list_all_v
constexpr bool type_list_any_v
std::is_invocable_r< void, Callable, const EventType & > type
Definition Listener.hpp:21
Kokkos::Impl::filter_type_list_t< impl::IsListenerFor< Callable >::template type, EventTypeList > type
Definition Listener.hpp:30