1#ifndef KOKKOS_EXECUTION_IMPL_CUDA_EVENT_HPP
2#define KOKKOS_EXECUTION_IMPL_CUDA_EVENT_HPP
4#include "Kokkos_Core.hpp"
24 explicit Event(
const Kokkos::Cuda& exec) {
31 :
m_event(std::exchange(other.m_event,
nullptr))
37 KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventDestroy(
m_event));
39 m_event = std::exchange(other.m_event,
nullptr);
47 KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventDestroy(
m_event));
50 void record(
const Kokkos::Cuda& exec) {
52 KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventCreateWithFlags(&
m_event, cudaEventDisableTiming));
54 KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventRecord(
m_event, exec.cuda_stream()));
60 if (cudaEventQuery(
m_event) != cudaSuccess) {
61 KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventSynchronize(
m_event));
static constexpr auto invalid_event_id
void record_event(const Exec &exec, uint64_t &event_id)
Event(const Kokkos::Cuda &) -> Event< Kokkos::Cuda >
void wait_event(const uint64_t event_id)
Event & operator=(const Event &)=delete
Event & operator=(Event &&other) noexcept
Event(const Event &)=delete
Event(Event &&other) noexcept
void record(const Kokkos::Cuda &exec)
Event(const Kokkos::Cuda &exec)
An event that can be recorded on an execution space instance.
Determine if events are supported.