kokkos-execution 0.0.1
Loading...
Searching...
No Matches
events.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_TESTS_GRAPH_EVENTS_HPP
2#define KOKKOS_EXECUTION_TESTS_GRAPH_EVENTS_HPP
3
5
7
8namespace Tests::GraphImpl {
9
14
15// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
16#define MATCHER_FOR_GRAPH_CREATE(_device_handle_) \
17 AGraphCreateEvent( \
18 ::testing::Field( \
19 &Kokkos::Execution::GraphImpl::GraphCreateEvent::dev_id, \
20 ::testing::Eq(Kokkos::Tools::Experimental::device_id(_device_handle_.m_exec))))
21
22// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
23#define MATCHER_FOR_GRAPH_ADDNODE(_graph_create_event_variant_, _device_handle_, _predecessor_) \
24 AGraphAddNodeEvent( \
25 ::testing::Field( \
26 &Kokkos::Execution::GraphImpl::GraphAddNodeEvent::dev_id, \
27 ::testing::Eq(Kokkos::Tools::Experimental::device_id(_device_handle_.m_exec))), \
28 ::testing::Field( \
29 &Kokkos::Execution::GraphImpl::GraphAddNodeEvent::graph, \
30 ::testing::Eq( \
31 std::get<Kokkos::Execution::GraphImpl::GraphCreateEvent>(_graph_create_event_variant_).graph)), \
32 ::testing::Field(&Kokkos::Execution::GraphImpl::GraphAddNodeEvent::predecessor, ::testing::Eq(_predecessor_)))
33
34// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
35#define MATCHER_FOR_GRAPH_NODE_OF(_graph_add_node_event_) \
36 std::get<Kokkos::Execution::GraphImpl::GraphAddNodeEvent>(_graph_add_node_event_).node
37
38// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
39#define MATCHER_FOR_GRAPH_INSTANTIATE(_graph_create_event_variant_) \
40 AGraphInstantiateEvent( \
41 ::testing::Field( \
42 &Kokkos::Execution::GraphImpl::GraphInstantiateEvent::graph, \
43 ::testing::Eq( \
44 std::get<Kokkos::Execution::GraphImpl::GraphCreateEvent>(_graph_create_event_variant_).graph)))
45
46// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
47#define MATCHER_FOR_GRAPH_SUBMIT(_exec_, _graph_create_event_variant_) \
48 AGraphSubmitEvent( \
49 ::testing::Field( \
50 &Kokkos::Execution::GraphImpl::GraphSubmitEvent::dev_id, \
51 ::testing::Eq(Kokkos::Tools::Experimental::device_id(_exec_))), \
52 ::testing::Field( \
53 &Kokkos::Execution::GraphImpl::GraphSubmitEvent::graph, \
54 ::testing::Eq( \
55 std::get<Kokkos::Execution::GraphImpl::GraphCreateEvent>(_graph_create_event_variant_).graph)))
56
57
59template <Kokkos::ExecutionSpace Exec>
67 constexpr bool operator()(const Kokkos::utils::callbacks::BeginFenceEvent& event) const {
68 return event.name != "Kokkos::DefaultGraph::submit: fencing before launching graph nodes"
69 && event.name != "Kokkos::DefaultGraphNode::execute_node: sync with predecessors"
70 && event.name != "Kokkos::GraphImpl::~GraphImpl: Graph Destruction";
71 }
72
73 template <Kokkos::utils::callbacks::Event EventType>
74 constexpr bool operator()(const EventType&) const {
75 return true;
76 }
77};
78
79} // namespace Tests::GraphImpl
80
81#endif // KOKKOS_EXECUTION_TESTS_GRAPH_EVENTS_HPP
#define DEFINE_EVENT_MATCHER_IN(__namespace__, __eventtype__)
Similar to EventDiscardMatcher, for graph-related events.
Definition events.hpp:60
constexpr bool operator()(const EventType &) const
Definition events.hpp:74
constexpr bool operator()(const Kokkos::utils::callbacks::BeginFenceEvent &event) const
Definition events.hpp:67