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

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

#include <CL/sycl/event.hpp>

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
 
bool is_host () const
 Returns a valid OpenCL event interoperability handle. 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<info::event param>
info::param_traits< info::event, param >::return_type get_info () const
 Queries this SYCL event for information. More...
 
template<info::event_profiling param>
info::param_traits< info::event_profiling, 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...
 
template<backend Backend>
backend_return_t< Backend, eventget_native () const
 Gets the native handle of the SYCL event. 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 >
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 31 of file event.hpp.

Constructor & Destructor Documentation

◆ event() [1/3]

cl::sycl::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]

cl::sycl::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]

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

Member Function Documentation

◆ get_backend()

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

Returns the backend associated with this platform.

Returns
the backend associated with this platform

Definition at line 89 of file event.cpp.

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

◆ get_info()

template<info::event param>
info::param_traits<info::event, param>::return_type cl::sycl::event::get_info ( ) const

Queries this SYCL event for information.

Returns
depends on the information being requested.

◆ get_native()

template<backend Backend>
backend_return_t<Backend, event> cl::sycl::event::get_native ( ) const
inline

Gets the native handle of the SYCL event.

Returns
a native handle, the type of which defined by the backend.

Definition at line 135 of file event.hpp.

◆ get_profiling_info()

template<info::event_profiling param>
info::param_traits<info::event_profiling, param>::return_type cl::sycl::event::get_profiling_info ( ) const

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.

◆ get_wait_list()

std::vector< event > cl::sycl::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 55 of file event.cpp.

◆ is_host()

bool cl::sycl::event::is_host ( ) const

Returns a valid OpenCL event interoperability handle.

Returns
a valid instance of OpenCL cl_event. Checks if this event is a SYCL host event.
true if this event is a SYCL host event.

Definition at line 37 of file event.cpp.

◆ operator!=()

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

Definition at line 33 of file event.cpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==()

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

Definition at line 31 of file event.cpp.

◆ wait() [1/2]

void cl::sycl::event::wait ( )

Wait for the event.

Definition at line 39 of file event.cpp.

◆ wait() [2/2]

void cl::sycl::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 41 of file event.cpp.

◆ wait_and_throw() [1/2]

void cl::sycl::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 47 of file event.cpp.

◆ wait_and_throw() [2/2]

void cl::sycl::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 49 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 119 of file backend.hpp.


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