8#include <sycl/sycl.hpp>
10#include <dr/sp/detail.hpp>
14template <
typename T,
typename Event = sycl::event>
class future {
16 using event_type = Event;
18 future(std::unique_ptr<T> &&value,
const std::vector<Event> &events)
19 : value_(std::move(value)), events_(events) {}
21 future(T &&value,
const std::vector<Event> &events)
22 : value_(
new T(std::move(value))), events_(events) {}
24 void update(
const Event &event) { events_.push_back(event); }
34 return std::move(*value_);
37 std::vector<Event> events()
const {
return events_; }
39 T &value()
const {
return *value_; }
41 void wait() { __detail::wait(events_); }
44 std::unique_ptr<T> value_;
45 std::vector<Event> events_;
Definition: future.hpp:14