9.1
general documentation
cs_task Class Reference

#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_taskoperator= (cs_task const &)=delete
 
 cs_task (cs_task &&)=default
 
cs_taskoperator= (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_contextget_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ cs_task() [1/3]

cs_task ( cs_task const &  )
delete

◆ cs_task() [2/3]

cs_task ( cs_task &&  )
default

◆ cs_task() [3/3]

cs_task ( cs_dispatch_context  context = {})
inline

Create a new task with a given context and initialize a new stream.

◆ ~cs_task()

~cs_task ( )
inline

Waits for task termination and destroys the associated CUDA stream.

Member Function Documentation

◆ add_dependency() [1/2]

void add_dependency ( cs_event_ref  event)
inline

Add an event to wait for.

◆ add_dependency() [2/2]

void add_dependency ( std::initializer_list< cs_event_ref > const &  sync_events)
inline

Wait for all the events in sync_events. Elements of sync_events must be convertible to cs_event.

◆ get_context()

cs_dispatch_context & get_context ( )
inline

Return a reference to the context.

◆ get_end_event()

cs_event_ref get_end_event ( )
inline

Return a reference to the end event.

◆ get_start_event()

cs_event_ref get_start_event ( )
inline

Return a reference to the start event.

◆ operator cs_event_ref()

operator cs_event_ref ( )
inline

Call record_event() to implicitely convert a task to an event.

◆ operator=() [1/2]

cs_task & operator= ( cs_task &&  )
default

◆ operator=() [2/2]

cs_task & operator= ( cs_task const &  )
delete

◆ record_end_event()

cs_event_ref record_end_event ( )
inline

Record an event from the task and return a cs_event_ref to it.

◆ wait()

void wait ( void  )
inline

Wait for task completion.


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