#include <cs_dispatch_queue.h>
Inheritance diagram for cs_task:
Collaboration diagram for cs_task:Public Member Functions | |
| cs_task (cs_task const &)=delete | |
| cs_task & | operator= (cs_task const &)=delete |
| cs_task (cs_task &&)=default | |
| cs_task & | operator= (cs_task &&)=default |
| cs_task (cs_dispatch_context context={}) | |
| Create a new task with a given context and initialize a new stream. More... | |
| void | add_dependency (cs_event_ref event) |
| Add an event to wait for. More... | |
| void | add_dependency (std::initializer_list< cs_event_ref > const &sync_events) |
| void | wait () |
| Wait for task completion. More... | |
| cs_event_ref | record_end_event () |
| Record an event from the task and return a cs_event_ref to it. More... | |
| operator cs_event_ref () | |
| Call record_event() to implicitely convert a task to an event. More... | |
| cs_dispatch_context & | get_context () |
| Return a reference to the context. More... | |
| cs_event_ref | get_start_event () |
| Return a reference to the start event. More... | |
| cs_event_ref | get_end_event () |
| Return a reference to the end event. More... | |
| ~cs_task () | |
| Waits for task termination and destroys the associated CUDA stream. More... | |
A cs_task_t object represents a task that can be syncronized to and with. It holds a cs_dispatch_context with a unique CUDA stream and CUDA events can be recorded from the task to synchronize other tasks with it.
cs_task_t objects are meant to be spawned from a cs_dispatch_queue object.
|
inline |
Create a new task with a given context and initialize a new stream.
|
inline |
Waits for task termination and destroys the associated CUDA stream.
|
inline |
Add an event to wait for.
|
inline |
Wait for all the events in sync_events. Elements of sync_events must be convertible to cs_event.
|
inline |
Return a reference to the context.
|
inline |
Return a reference to the end event.
|
inline |
Return a reference to the start event.
|
inline |
Call record_event() to implicitely convert a task to an event.
|
inline |
Record an event from the task and return a cs_event_ref to it.
|
inline |
Wait for task completion.