1#ifndef KOKKOS_EXECUTION_IMPL_HIP_EVENT_HPP
2#define KOKKOS_EXECUTION_IMPL_HIP_EVENT_HPP
4#include "Kokkos_Core.hpp"
30 KOKKOS_IMPL_HIP_SAFE_CALL(hipEventDestroy(
m_event));
33 void record(
const Kokkos::HIP& exec) {
35 KOKKOS_IMPL_HIP_SAFE_CALL(hipEventCreateWithFlags(&
m_event, hipEventDisableTiming));
37 KOKKOS_IMPL_HIP_SAFE_CALL(hipEventRecord(
m_event, exec.hip_stream()));
41 if (hipEventQuery(
m_event) != hipSuccess) {
42 KOKKOS_IMPL_HIP_SAFE_CALL(hipEventSynchronize(
m_event));
52template <Kokkos::ExecutionSpace... ExecFrom>
53requires(std::same_as<ExecFrom, Kokkos::HIP> && ...)
55 auto do_impl_wait = [&exec](
const auto&
event) {
56 KOKKOS_EXPECTS(
bool(
event.hip_event()));
57 KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamWaitEvent(exec.hip_stream(),
event.hip_event()));
59 (do_impl_wait(events), ...);
Constrain an EventType type to be a valid event type for Exec execution space type.
static constexpr auto invalid_event_id
void impl_wait(const Kokkos::Cuda &exec, const Event< ExecFrom > &... events)
Event(const Event &)=delete
void record(const Kokkos::HIP &exec)
Event & operator=(const Event &)=delete
constexpr hipEvent_t hip_event() const noexcept
Event(Event &&) noexcept=delete
An event that can be recorded on an execution space instance.
Determine if the Kokkos backend has non-blocking dispatch.