20 #include <unordered_set>
23 inline namespace _V1 {
28 : impl(
std::make_shared<detail::event_impl>(
33 detail::pi::cast<sycl::detail::pi::PiEvent>(ClEvent));
40 bool event::is_host()
const {
41 bool IsHost = impl->is_host();
42 assert(!IsHost &&
"event::is_host should not be called in implementation.");
49 for (
auto E : EventList) {
57 for (
auto E : EventList) {
63 std::vector<event> Result;
65 for (
auto &EventImpl : impl->getWaitList())
66 Result.push_back(detail::createSyclObjFromImpl<event>(EventImpl));
71 event::event(std::shared_ptr<detail::event_impl> event_impl)
74 template <
typename Param>
75 typename detail::is_event_info_desc<Param>::return_type
77 return impl->template get_info<Param>();
80 template <
typename Param>
83 return impl->get_backend_info<Param>();
86 template <
typename Param>
89 if (impl->getCommandGraph()) {
91 "Profiling information is unavailable for events "
92 "returned from a submission to a queue in the "
96 if constexpr (!std::is_same_v<Param, info::event_profiling::command_submit>) {
99 return impl->template get_profiling_info<Param>();
102 #define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
103 template __SYCL_EXPORT ReturnT event::get_info<info::event::Desc>() const;
105 #include <sycl/info/event_traits.def>
107 #undef __SYCL_PARAM_TRAITS_SPEC
109 #define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, Picode) \
110 template __SYCL_EXPORT ReturnT \
111 event::get_backend_info<info::DescType::Desc>() const;
113 #include <sycl/info/sycl_backend_traits.def>
115 #undef __SYCL_PARAM_TRAITS_SPEC
117 #define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
118 template __SYCL_EXPORT ReturnT \
119 event::get_profiling_info<info::DescType::Desc>() const;
121 #include <sycl/info/event_profiling_traits.def>
123 #undef __SYCL_PARAM_TRAITS_SPEC
129 std::vector<pi_native_handle> event::getNativeVector()
const {
130 std::vector<pi_native_handle> ReturnVector = {impl->getNative()};
The context class represents a SYCL context on which kernel functions may be executed.
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
std::vector< event > get_wait_list()
Return the list of events that this event waits for.
void wait()
Wait for the event.
event()
Constructs a ready SYCL event.
bool operator!=(const event &rhs) const
backend get_backend() const noexcept
Returns the backend associated with this platform.
bool operator==(const event &rhs) const
void wait_and_throw()
Wait for the event.
detail::is_event_profiling_info_desc< Param >::return_type get_profiling_info() const
Queries this SYCL event for profiling information.
detail::is_event_info_desc< Param >::return_type get_info() const
Queries this SYCL event for information.
detail::is_backend_info_desc< Param >::return_type get_backend_info() const
Queries this SYCL event for SYCL backend-specific information.
PiProgram cast(cl_program)=delete
backend getImplBackend(const T &Impl)
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
uintptr_t pi_native_handle
pi_result piEventRetain(pi_event event)
C++ wrapper of extern "C" PI interfaces.
_Abi const simd< _Tp, _Abi > & noexcept