1#ifndef KOKKOS_EXECUTION_IMPL_HPX_EVENT_HPP
2#define KOKKOS_EXECUTION_IMPL_HPX_EVENT_HPP
4#include "Kokkos_Core.hpp"
12#if !defined(KOKKOS_ENABLE_IMPL_HPX_ASYNC_DISPATCH)
13# error "This is not supported."
23 mutable std::optional<Kokkos::Experimental::HPX>
m_exec = std::nullopt;
28 explicit Event(
const Kokkos::Experimental::HPX& exec) {
35 :
m_exec(std::move(other.m_exec))
40 m_exec = std::move(other.m_exec);
47 void record(
const Kokkos::Experimental::HPX& exec) {
70 auto& instance_data =
m_exec->impl_get_instance_data();
73 const std::lock_guard<hpx::spinlock> lock(instance_data.m_sender_mutex);
75 auto& sndr = instance_data.m_sender;
76 hpx::this_thread::experimental::sync_wait(std::move(sndr));
77 sndr = hpx::execution::experimental::unique_any_sender<>(hpx::execution::experimental::just());
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(const Kokkos::Experimental::HPX &exec)
Event(const Event &)=delete
Event(Event &&other) noexcept
std::optional< Kokkos::Experimental::HPX > m_exec
void record(const Kokkos::Experimental::HPX &exec)
Event & operator=(const Event &)=delete
Event & operator=(Event &&other) noexcept
An event that can be recorded on an execution space instance.
Determine if events are supported.