1#ifndef KOKKOS_EXECUTION_TESTS_GRAPH_EVENTS_HPP
2#define KOKKOS_EXECUTION_TESTS_GRAPH_EVENTS_HPP
17#define MATCHER_FOR_GRAPH_CREATE(_device_handle_) \
20 &Kokkos::Execution::GraphImpl::GraphCreateEvent::dev_id, \
21 ::testing::Eq(Kokkos::Tools::Experimental::device_id(_device_handle_.m_exec))))
24#define MATCHER_FOR_GRAPH_ADDNODE(_graph_create_event_variant_, _device_handle_, _predecessor_) \
27 &Kokkos::Execution::GraphImpl::GraphAddNodeEvent::dev_id, \
28 ::testing::Eq(Kokkos::Tools::Experimental::device_id(_device_handle_.m_exec))), \
30 &Kokkos::Execution::GraphImpl::GraphAddNodeEvent::graph, \
32 std::get<Kokkos::Execution::GraphImpl::GraphCreateEvent>(_graph_create_event_variant_).graph)), \
33 ::testing::Field(&Kokkos::Execution::GraphImpl::GraphAddNodeEvent::predecessor, ::testing::Eq(_predecessor_)))
36#define MATCHER_FOR_GRAPH_ADD_AGGREGATE_NODE(_graph_create_event_variant_, ...) \
37 AGraphAddAggregateNodeEvent( \
39 &Kokkos::Execution::GraphImpl::GraphAddAggregateNodeEvent::graph, \
41 std::get<Kokkos::Execution::GraphImpl::GraphCreateEvent>(_graph_create_event_variant_).graph)), \
43 &Kokkos::Execution::GraphImpl::GraphAddAggregateNodeEvent::predecessors, \
44 ::testing::ElementsAre(__VA_ARGS__)))
47#define MATCHER_FOR_GRAPH_NODE_OF(_graph_add_node_event_) \
48 std::get<Kokkos::Execution::GraphImpl::GraphAddNodeEvent>(_graph_add_node_event_).node
51#define MATCHER_FOR_GRAPH_AGGREGATE_NODE_OF(_graph_add_aggregate_node_event_) \
52 std::get<Kokkos::Execution::GraphImpl::GraphAddAggregateNodeEvent>(_graph_add_aggregate_node_event_).node
55#define MATCHER_FOR_GRAPH_INSTANTIATE(_graph_create_event_variant_) \
56 AGraphInstantiateEvent( \
58 &Kokkos::Execution::GraphImpl::GraphInstantiateEvent::graph, \
60 std::get<Kokkos::Execution::GraphImpl::GraphCreateEvent>(_graph_create_event_variant_).graph)))
63#define MATCHER_FOR_GRAPH_SUBMIT(_exec_, _graph_create_event_variant_) \
66 &Kokkos::Execution::GraphImpl::GraphSubmitEvent::dev_id, \
67 ::testing::Eq(Kokkos::Tools::Experimental::device_id(_exec_))), \
69 &Kokkos::Execution::GraphImpl::GraphSubmitEvent::graph, \
71 std::get<Kokkos::Execution::GraphImpl::GraphCreateEvent>(_graph_create_event_variant_).graph)))
75template <Kokkos::ExecutionSpace Exec>
84 return event.name !=
"Kokkos::DefaultGraph::submit: fencing before launching graph nodes"
85 &&
event.name !=
"Kokkos::DefaultGraphNode::execute_node: sync with predecessors"
86 &&
event.name !=
"Kokkos::GraphImpl::~GraphImpl: Graph Destruction";
89 template <Kokkos::utils::callbacks::Event EventType>
#define DEFINE_EVENT_MATCHER_IN(__namespace__, __eventtype__)
Similar to EventDiscardMatcher, for graph-related events.
constexpr bool operator()(const EventType &) const
constexpr bool operator()(const Kokkos::utils::callbacks::BeginFenceEvent &event) const