kokkos-utils 0.0.1
 
Loading...
Searching...
No Matches
Matcher.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_UTILS_CALLBACKS_MATCHER_HPP
2#define KOKKOS_UTILS_CALLBACKS_MATCHER_HPP
3
5
7{
8
9namespace impl
10{
11
17template <typename Callable>
19{
20 template <Event EventType>
21 using type = std::is_invocable_r<bool, Callable, const EventType&>;
22};
23
24} // namespace impl
25
30template <typename Callable>
32
34template <typename Callable, typename... EventTypes>
36
38template <typename Callable>
39using matcher_event_type_list_t = Kokkos::Impl::filter_type_list_t<impl::IsMatcherFor<Callable>::template type, EventTypeList>;
40
43{
44 template <Event EventType>
45 constexpr bool operator()(const EventType&) const { return true; }
46};
47
48} // namespace Kokkos::utils::callbacks
49
50#endif // KOKKOS_UTILS_CALLBACKS_MATCHER_HPP
Check that Callable is a matcher for each event in EventTypes.
Definition Matcher.hpp:35
Callable is a matcher if it is invocable with at least one event type from Kokkos::utils::callbacks::...
Definition Matcher.hpp:31
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:199
Kokkos::Impl::filter_type_list_t< impl::IsMatcherFor< Callable >::template type, EventTypeList > matcher_event_type_list_t
Type list holding the event types that Callable can be a matcher for.
Definition Matcher.hpp:39
constexpr bool type_list_all_v
constexpr bool type_list_any_v
Matcher that returns true for any event.
Definition Matcher.hpp:43
constexpr bool operator()(const EventType &) const
Definition Matcher.hpp:45
std::is_invocable_r< bool, Callable, const EventType & > type
Definition Matcher.hpp:21