![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Class to manage a list of SYCL events. More...
#include <shambackends/include/shambackends/EventList.hpp>
Public Member Functions | |
| void | apply_dependency (sycl::handler &h) |
| Apply all events in the list as dependancies to a SYCL command group. | |
| void | wait () |
| Wait for all events in the list to be finished. | |
| void | wait_and_throw () |
| Wait for all events in the list to be finished and throw an exception if one has occurred. | |
| void | add_event (sycl::event e) |
| Add an event to the list of events. | |
| void | add_events (std::vector< sycl::event > &e) |
| Add multiple events to the list of events. | |
| void | add_events (sham::EventList &e) |
| Add all events from another EventList to this one. | |
| std::string | get_state () |
| Get a string representation of the EventList's state. | |
| EventList (SourceLocation loc=SourceLocation{}) | |
| Default constructor for EventList with source location. | |
| EventList (std::initializer_list< sycl::event > e, SourceLocation loc=SourceLocation{}) | |
| same constructor but with initializer list | |
| ~EventList () noexcept(false) | |
| Destructor for EventList. | |
| std::vector< sycl::event > & | get_events () |
| Get the list of events. | |
| const std::vector< sycl::event > & | get_events () const |
| Get the list of events (const) | |
| void | set_consumed (bool consumed) |
| Set the consumed state of the EventList (to be used with interop) | |
Friends | |
| class | DeviceQueue |
| class | details::BufferEventHandler |
Class to manage a list of SYCL events.
Definition at line 31 of file EventList.hpp.
|
inline |
Default constructor for EventList with source location.
Definition at line 134 of file EventList.hpp.
|
inline |
same constructor but with initializer list
Definition at line 137 of file EventList.hpp.
| sham::EventList::~EventList | ( | ) |
Destructor for EventList.
This destructor checks if the EventList has not been consumed and still contains events. If so, it logs an error message and throws a runtime exception after waiting for all events.
Definition at line 19 of file EventList.cpp.
Here is the call graph for this function:
|
inline |
Add an event to the list of events.
Add a SYCL event to the list of events.
| e | The SYCL event to add. |
Definition at line 87 of file EventList.hpp.
|
inline |
Add all events from another EventList to this one.
Insert all events from another EventList into this one. The list is marked as not consumed after the insertion. The other list is marked as consumed after the insertion.
| e | The EventList from which to add all events. |
Definition at line 114 of file EventList.hpp.
|
inline |
Add multiple events to the list of events.
Inserts a list of SYCL events into the event list. The list is marked as not consumed after the insertion.
| e | A reference to a vector containing the SYCL events to add. |
Definition at line 100 of file EventList.hpp.
|
inline |
Apply all events in the list as dependancies to a SYCL command group.
| h | The SYCL command group handler. |
Example of usage:
Definition at line 49 of file EventList.hpp.
|
inline |
Get the list of events.
Definition at line 150 of file EventList.hpp.
|
inline |
Get the list of events (const)
Definition at line 153 of file EventList.hpp.
|
inline |
Get a string representation of the EventList's state.
This function returns a string representation of the EventList's state, including the number of events in the list and whether the list is considered consumed.
Definition at line 129 of file EventList.hpp.
|
inline |
Set the consumed state of the EventList (to be used with interop)
Definition at line 156 of file EventList.hpp.
|
inline |
Wait for all events in the list to be finished.
Waits for all events in the list to be finished. After calling this function, the list is considered consumed.
Definition at line 57 of file EventList.hpp.
|
inline |
Wait for all events in the list to be finished and throw an exception if one has occurred.
Waits for all events in the list to be finished. And throws an exception if one has occurred in any of the events.
Definition at line 72 of file EventList.hpp.
|
friend |
Definition at line 164 of file EventList.hpp.
|
friend |
Definition at line 163 of file EventList.hpp.