1#ifndef KOKKOS_EXECUTION_IMPL_EVENT_HPP
2#define KOKKOS_EXECUTION_IMPL_EVENT_HPP
7#include "Kokkos_Core.hpp"
9#if defined(KOKKOS_EXECUTION_ENABLE_EVENT_DISPATCH)
23template <
typename EventType,
typename Exec>
24concept event = Kokkos::ExecutionSpace<Exec> && std::default_initializable<EventType>
25 && std::constructible_from<EventType, const Exec&> && std::move_constructible<EventType>
26 &&
requires(EventType& obj,
const Exec& exec) {
27 { obj.record(exec) } -> std::same_as<void>;
28 } &&
requires(
const EventType& obj) {
29 { obj.wait() } -> std::same_as<void>;
33template <Kokkos::ExecutionSpace Exec>
37template <Kokkos::ExecutionSpace Exec>
40template <
typename Exec>
53template <Kokkos::ExecutionSpace Exec>
55#if defined(KOKKOS_EXECUTION_ENABLE_EVENT_DISPATCH)
58 RecordEvent{.dev_id = Kokkos::Tools::Experimental::device_id(exec), .event_id = event_id});
70#if defined(KOKKOS_EXECUTION_ENABLE_EVENT_DISPATCH)
77#if defined(KOKKOS_ENABLE_CUDA)
80#if defined(KOKKOS_ENABLE_HIP)
83#if defined(KOKKOS_ENABLE_HPX)
86#if defined(KOKKOS_ENABLE_SYCL)
Constrain an EventType type to be a valid event type for Exec execution space type.
static constexpr auto invalid_event_id
void record_event(const Exec &exec, uint64_t &event_id)
void wait_event(const uint64_t event_id)
auto get_next_event_id() noexcept
void dispatch(const EventType &event)
An event that can be recorded on an execution space instance.
Event to be sent to Kokkos::utils::callbacks::dispatch when an event is recorded on an execution spac...
constexpr auto operator<=>(const RecordEvent &) const =default
Determine if events are supported.
Event to be sent to Kokkos::utils::callbacks::dispatch when an event is being waited for.
constexpr auto operator<=>(const WaitEvent &) const =default