1#include "gmock/gmock.h"
2#include "gtest/gtest.h"
23#if !defined(KOKKOS_EXECUTION_ENABLE_EVENT_DISPATCH)
24# error "This is not supported."
29using namespace Kokkos::utils::callbacks;
58 std::declval<const EventsTest::graph_t::root_t&>(), std::declval<const EventsTest::graph_t::root_t&>())));
64 std::declval<const EventsTest::graph_t&>(), std::declval<const TEST_EXECUTION_SPACE&>())));
67 std::declval<const EventsTest::graph_t&>(), std::declval<const TEST_EXECUTION_SPACE&>())));
75 const auto recorded_events = recorder_listener_t::record([
this]() {
93 const auto recorded_events = recorder_listener_t::record([
this]() {
97 const auto root = graph.root_node();
99 const auto node_A = root.then(Kokkos::Experimental::node_props(
device_handle), KOKKOS_LAMBDA(){});
102 const auto node_B = node_A.then(Kokkos::Experimental::node_props(
device_handle), KOKKOS_LAMBDA(){});
107 testing::ElementsAre(
RecorderListener< GraphEventDiscardMatcher< TEST_EXECUTION_SPACE >, BeginFenceEvent, Kokkos::Execution::GraphImpl::GraphAddNodeEvent, Kokkos::Execution::GraphImpl::GraphCreateEvent, Kokkos::Execution::GraphImpl::GraphInstantiateEvent, Kokkos::Execution::GraphImpl::GraphSubmitEvent > recorder_listener_t
void graph_create_event(const Kokkos::Experimental::Graph< Exec > &graph)
Record a GraphCreateEvent event.
void graph_add_node_event(const Predecessor &predecessor, const NodeType &node)
Record an event for a node added after predecessor.
auto * get_node_ptr(const NodeType &node) noexcept
Retrieve the raw node pointer.
auto create_graph(const Kokkos::Impl::DeviceHandle< Exec > &device_handle, Args &&... args)
Create a graph and record the associated event with graph_create_event.
void graph_instantiate_event(const Kokkos::Experimental::Graph< Exec > &graph)
Record a GraphInstantiateEvent event.
void graph_submit_event(const Kokkos::Experimental::Graph< Exec > &graph, const Exec &exec)
Record a GraphSubmitEvent event.
auto * get_graph_impl_ptr(const NodeType &node) noexcept
Retrieve the raw graph pointer from a node.
void submit_graph(const Kokkos::Experimental::Graph< Exec > &graph, const Exec &exec)
Submit a graph and record the associated event with graph_submit_event.
consteval bool test_noexcept()
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph node is added.
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph is created.
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph is instantiated.
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph is submitted.
Similar to EventDiscardMatcher, for graph-related events.
Kokkos::Experimental::Graph< Exec > graph_t
device_handle_t device_handle
#define MATCHER_FOR_GRAPH_CREATE(_device_handle_)
#define MATCHER_FOR_GRAPH_SUBMIT(_exec_, _graph_create_event_variant_)
#define MATCHER_FOR_GRAPH_ADDNODE(_graph_create_event_variant_, _device_handle_, _predecessor_)
#define MATCHER_FOR_GRAPH_INSTANTIATE(_graph_create_event_variant_)
#define MATCHER_FOR_GRAPH_NODE_OF(_graph_add_node_event_)