Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
uni20::async::AsyncTask Class Referencefinal

Canonical host-oriented coroutine task type. More...

#include <async_task.hpp>

Inheritance diagram for uni20::async::AsyncTask:
[legend]
Collaboration diagram for uni20::async::AsyncTask:
[legend]

Public Types

using base_type = BasicTask
 
using promise_type = AsyncTaskPromise
 

Public Member Functions

 AsyncTask ()=default
 
 AsyncTask (AsyncTask &&) noexcept=default
 
 AsyncTask (AsyncTask const &)=delete
 
AsyncTask & debug_name (std::string const &label)
 
AsyncTask & operator= (AsyncTask &&) noexcept=default
 
AsyncTask & operator= (AsyncTask const &)=delete
 
- Public Member Functions inherited from uni20::async::BasicTask
void abandon_leak ()
 Intentionally leak the coroutine during emergency unwinding.
 
bool await_ready () const noexcept
 
void await_resume ()
 
template<TaskPromise ParentPromise>
std::coroutine_handle await_suspend (std::coroutine_handle< ParentPromise > parent)
 Await a nested task from any Uni20 task promise type.
 
 BasicTask () noexcept=default
 Construct an empty task.
 
 BasicTask (BasicTask &&other) noexcept
 Move-construct one ownership claim.
 
 BasicTask (BasicTask const &)=delete
 
std::coroutine_handle coroutine_handle () const noexcept
 Return the generic coroutine handle for diagnostics.
 
BasicTask & debug_name (std::string const &label)
 Assign an optional debug label.
 
void destroy () noexcept
 Destroy an exclusively owned coroutine.
 
void exception_on_resume (std::exception_ptr error) noexcept
 Store an exception for delivery on the next resume.
 
TaskHandle handle () const noexcept
 Return the erased task identity.
 
 operator bool () const noexcept
 
BasicTask & operator= (BasicTask &&other) noexcept
 Move-assign one ownership claim.
 
BasicTask & operator= (BasicTask const &)=delete
 
std::optional< int > preferred_numa_node () const noexcept
 
TaskHandle release_handle ()
 Release this ownership claim to a scheduler activation.
 
void resume ()
 Resume the coroutine and transfer this ownership claim.
 
void set_cancel_on_resume () noexcept
 Request cancellation before the next resume.
 
void set_preferred_numa_node (std::optional< int > node) noexcept
 
bool set_scheduler (IScheduler *scheduler)
 Install the scheduler used for later resumption.
 
 ~BasicTask () noexcept
 Release the ownership claim and destroy the frame when appropriate.
 

Friends

class AsyncTaskPromise
 

Additional Inherited Members

- Static Public Member Functions inherited from uni20::async::BasicTask
static BasicTask make_sole_owner (BasicTask &&task)
 Retain a task only when it is the sole ownership claimant.
 
static void reschedule (BasicTask task)
 Reschedule a task when it becomes the sole ownership claimant.
 
- Protected Member Functions inherited from uni20::async::BasicTask
 BasicTask (TaskHandle handle, construction_key) noexcept
 

Detailed Description

Canonical host-oriented coroutine task type.

Member Typedef Documentation

◆ base_type

◆ promise_type

Constructor & Destructor Documentation

◆ AsyncTask() [1/3]

uni20::async::AsyncTask::AsyncTask ( )
default

◆ AsyncTask() [2/3]

uni20::async::AsyncTask::AsyncTask ( AsyncTask const &  )
delete

◆ AsyncTask() [3/3]

uni20::async::AsyncTask::AsyncTask ( AsyncTask &&  )
defaultnoexcept

Member Function Documentation

◆ debug_name()

AsyncTask & uni20::async::AsyncTask::debug_name ( std::string const &  label)
inline

◆ operator=() [1/2]

AsyncTask & uni20::async::AsyncTask::operator= ( AsyncTask &&  )
defaultnoexcept

◆ operator=() [2/2]

AsyncTask & uni20::async::AsyncTask::operator= ( AsyncTask const &  )
delete

Friends And Related Symbol Documentation

◆ AsyncTaskPromise

friend class AsyncTaskPromise
friend

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