DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::event Class Reference

An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barriers. More...

#include <sycl/event.hpp>

Inheritance diagram for sycl::_V1::event:
Collaboration diagram for sycl::_V1::event:

Public Member Functions

 event ()
 Constructs a ready SYCL event. More...
 
 event (const event &rhs)=default
 Constructs a SYCL event instance from an OpenCL cl_event. More...
 
 event (event &&rhs)=default
 
eventoperator= (const event &rhs)=default
 
eventoperator= (event &&rhs)=default
 
bool operator== (const event &rhs) const
 
bool operator!= (const event &rhs) const
 
 __SYCL2020_DEPRECATED ("is_host() is deprecated as the host device is no longer supported.") bool is_host() const
 Checks if this event is a SYCL host event. More...
 
std::vector< eventget_wait_list ()
 Return the list of events that this event waits for. More...
 
void wait ()
 Wait for the event. More...
 
void wait_and_throw ()
 Wait for the event. More...
 
template<typename Param >
detail::is_event_info_desc< Param >::return_type get_info () const
 Queries this SYCL event for information. More...
 
template<typename Param >
detail::is_backend_info_desc< Param >::return_type get_backend_info () const
 Queries this SYCL event for SYCL backend-specific information. More...
 
template<typename Param >
detail::is_event_profiling_info_desc< Param >::return_type get_profiling_info () const
 Queries this SYCL event for profiling information. More...
 
backend get_backend () const noexcept
 Returns the backend associated with this platform. More...
 
- Public Member Functions inherited from sycl::_V1::detail::OwnerLessBase< event >
bool ext_oneapi_owner_before (const ext::oneapi::detail::weak_object_base< event > &Other) const noexcept
 Compares the object against a weak object using an owner-based implementation-defined ordering. More...
 
bool ext_oneapi_owner_before (const event &Other) const noexcept
 Compares the object against another object using an owner-based implementation-defined ordering. More...
 

Static Public Member Functions

static void wait (const std::vector< event > &EventList)
 Synchronously wait on a list of events. More...
 
static void wait_and_throw (const std::vector< event > &EventList)
 Synchronously wait on a list of events. More...
 

Friends

template<class T >
detail::createSyclObjFromImpl (decltype(T::impl) ImplObj)
 
template<backend BackendName, class SyclObjectT >
auto get_native (const SyclObjectT &Obj) -> backend_return_t< BackendName, SyclObjectT >
 

Detailed Description

An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barriers.

Definition at line 44 of file event.hpp.

Constructor & Destructor Documentation

◆ event() [1/3]

sycl::_V1::event::event ( )

Constructs a ready SYCL event.

If the constructed SYCL event is waited on it will complete immediately.

Definition at line 25 of file event.cpp.

◆ event() [2/3]

sycl::_V1::event::event ( const event rhs)
default

Constructs a SYCL event instance from an OpenCL cl_event.

The SyclContext must match the OpenCL context associated with the ClEvent.

Parameters
ClEventis a valid instance of OpenCL cl_event.
SyclContextis an instance of SYCL context.

◆ event() [3/3]

sycl::_V1::event::event ( event &&  rhs)
default

Member Function Documentation

◆ __SYCL2020_DEPRECATED()

sycl::_V1::event::__SYCL2020_DEPRECATED ( "is_host() is deprecated as the host device is no longer supported."  ) const

Checks if this event is a SYCL host event.

Returns
true if this event is a SYCL host event.

◆ get_backend()

backend sycl::_V1::event::get_backend ( ) const
noexcept

Returns the backend associated with this platform.

Returns
the backend associated with this platform

Definition at line 125 of file event.cpp.

References sycl::_V1::detail::getImplBackend().

Referenced by sycl::_V1::ext::oneapi::cuda::has_native_event().

◆ get_backend_info()

template<typename Param >
detail::is_backend_info_desc< Param >::return_type sycl::_V1::event::get_backend_info

Queries this SYCL event for SYCL backend-specific information.

Returns
depends on information being queried.

Definition at line 82 of file event.cpp.

◆ get_info()

template<typename Param >
detail::is_event_info_desc< Param >::return_type sycl::_V1::event::get_info

Queries this SYCL event for information.

Returns
depends on the information being requested.

Definition at line 76 of file event.cpp.

Referenced by sycl::_V1::ext::intel::experimental::pipe< _name, _dataT, _min_capacity, _propertiesT, class >::read(), and sycl::_V1::ext::intel::experimental::pipe< _name, _dataT, _min_capacity, _propertiesT, class >::write().

◆ get_profiling_info()

template<typename Param >
detail::is_event_profiling_info_desc< Param >::return_type sycl::_V1::event::get_profiling_info

Queries this SYCL event for profiling information.

If the requested info is not available when this member function is called due to incompletion of command groups associated with the event, then the call to this member function will block until the requested info is available. If the queue which submitted the command group this event is associated with was not constructed with the property::queue::enable_profiling property, an invalid_object_error SYCL exception is thrown.

Returns
depends on template parameter.

Definition at line 88 of file event.cpp.

References sycl::_V1::invalid, and sycl::_V1::make_error_code().

◆ get_wait_list()

std::vector< event > sycl::_V1::event::get_wait_list ( )

Return the list of events that this event waits for.

Only direct dependencies are returned. Already completed events are not included in the returned vector.

Returns
a vector of SYCL events.

Definition at line 62 of file event.cpp.

◆ operator!=()

bool sycl::_V1::event::operator!= ( const event rhs) const

Definition at line 38 of file event.cpp.

◆ operator=() [1/2]

event& sycl::_V1::event::operator= ( const event rhs)
default

◆ operator=() [2/2]

event& sycl::_V1::event::operator= ( event &&  rhs)
default

◆ operator==()

bool sycl::_V1::event::operator== ( const event rhs) const

Definition at line 36 of file event.cpp.

◆ wait() [1/2]

void sycl::_V1::event::wait ( )

Wait for the event.

Definition at line 46 of file event.cpp.

Referenced by syclcompat::detail::matrix_mem_copy().

◆ wait() [2/2]

void sycl::_V1::event::wait ( const std::vector< event > &  EventList)
static

Synchronously wait on a list of events.

Parameters
EventListis a vector of SYCL events.

Definition at line 48 of file event.cpp.

◆ wait_and_throw() [1/2]

void sycl::_V1::event::wait_and_throw ( )

Wait for the event.

If any uncaught asynchronous errors occurred on the context that the event is waiting on executions from, then call that context's asynchronous error handler with those errors.

Definition at line 54 of file event.cpp.

◆ wait_and_throw() [2/2]

void sycl::_V1::event::wait_and_throw ( const std::vector< event > &  EventList)
static

Synchronously wait on a list of events.

If any uncaught asynchronous errors occurred on the context that the events are waiting on executions from, then call those contexts' asynchronous error handlers with those errors.

Parameters
EventListis a vector of SYCL events.

Definition at line 56 of file event.cpp.

Friends And Related Function Documentation

◆ detail::createSyclObjFromImpl

template<class T >
T detail::createSyclObjFromImpl ( decltype(T::impl)  ImplObj)
friend

◆ get_native

template<backend BackendName, class SyclObjectT >
auto get_native ( const SyclObjectT &  Obj) -> backend_return_t< BackendName, SyclObjectT >
friend

Definition at line 136 of file backend.hpp.


The documentation for this class was generated from the following files: