kokkos-utils 0.0.1
 
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
13template <typename Callable>
15{
16 template <Event EventType>
17 using type = std::is_invocable_r<void, Callable, const EventType&>;
18};
19
20} // namespace impl
21
23template <typename Callable>
24using listener_event_type_list_t = Kokkos::Impl::filter_type_list_t<impl::IsListenerFor<Callable>::template type, EventTypeList>;
25
30template <typename Callable>
31concept Listener = ( ! std::same_as<listener_event_type_list_t<Callable>, Kokkos::Impl::type_list<>>);
32
33} // namespace Kokkos::utils::callbacks
34
35#endif // KOKKOS_UTILS_CALLBACKS_LISTENER_HPP
Concept that models that a callable object to be registered as a listener by Kokkos::utils::callbacks...
Definition Listener.hpp:31
Kokkos::Impl::filter_type_list_t< impl::IsListenerFor< Callable >::template type, EventTypeList > listener_event_type_list_t
Type list holding the event types that a callable object can be a listener for.
Definition Listener.hpp:24
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:152
Helper struct needed for the implementation of Kokkos::utils::callbacks::listener_event_type_list_t.
Definition Listener.hpp:15
std::is_invocable_r< void, Callable, const EventType & > type
Definition Listener.hpp:17