kokkos-utils
0.0.5
Toggle main menu visibility
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
4
#include "
kokkos-utils/callbacks/Events.hpp
"
5
6
namespace
Kokkos::utils::callbacks
7
{
8
9
namespace
impl
10
{
11
17
template
<
typename
Callable>
18
struct
IsMatcherFor
19
{
20
template
<Event EventType>
21
using
type
= std::is_invocable_r<bool, Callable, const EventType&>;
22
};
23
24
}
// namespace impl
25
30
template
<
typename
Callable>
31
concept
Matcher
=
Kokkos::utils::impl::type_list_any_v<impl::IsMatcherFor<Callable>::template
type,
EventTypeList
>;
32
34
template
<
typename
Callable,
typename
... EventTypes>
35
concept
MatcherFor
=
Kokkos::utils::impl::type_list_all_v<impl::IsMatcherFor<Callable>::template
type, EventTypes...>;
36
38
template
<
typename
Callable>
39
using
matcher_event_type_list_t
= Kokkos::Impl::filter_type_list_t<impl::IsMatcherFor<Callable>::template type,
EventTypeList
>;
40
42
struct
AnyEventMatcher
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
Events.hpp
Kokkos::utils::callbacks::MatcherFor
Check that Callable is a matcher for each event in EventTypes.
Definition
Matcher.hpp:35
Kokkos::utils::callbacks::Matcher
Callable is a matcher if it is invocable with at least one event type from Kokkos::utils::callbacks::...
Definition
Matcher.hpp:31
Kokkos::utils::callbacks::impl
Definition
Helpers.hpp:68
Kokkos::utils::callbacks
Definition
BeginEndTimerListener.hpp:12
Kokkos::utils::callbacks::EventTypeList
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
Kokkos::utils::callbacks::matcher_event_type_list_t
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
Kokkos::utils::impl::type_list_all_v
constexpr bool type_list_all_v
Definition
type_list.hpp:158
Kokkos::utils::impl::type_list_any_v
constexpr bool type_list_any_v
Definition
type_list.hpp:208
Kokkos::utils::callbacks::AnyEventMatcher
Matcher that returns true for any event.
Definition
Matcher.hpp:43
Kokkos::utils::callbacks::AnyEventMatcher::operator()
constexpr bool operator()(const EventType &) const
Definition
Matcher.hpp:45
Kokkos::utils::callbacks::impl::IsMatcherFor
Definition
Matcher.hpp:19
Kokkos::utils::callbacks::impl::IsMatcherFor::type
std::is_invocable_r< bool, Callable, const EventType & > type
Definition
Matcher.hpp:21
include
kokkos-utils
callbacks
Matcher.hpp
Generated on
for kokkos-utils by
1.18.0