|
Uni20
Asynchronous tensor and runtime library.
|
Configurable debug scheduler that admits ordinary and CUDA tasks. More...
#include <debug_cuda_scheduler.hpp>
Public Member Functions | |
| DebugCudaScheduler (cuda::Device default_device, DebugSchedulerOptions options={}) | |
| Construct with an explicit default CUDA activation device. | |
| DebugCudaScheduler (DebugSchedulerOptions options={}) | |
| Construct with device zero as the default CUDA activation device. | |
| void | schedule (AsyncTask &&task) override |
| Enqueue a task for later run. | |
| void | schedule (CudaTask &&task) override |
| Enqueue a CUDA task without establishing device affinity. | |
| void | schedule (CudaTask &&task, int device) override |
| Bind and enqueue a CUDA task for initial execution on a device. | |
Public Member Functions inherited from uni20::async::DebugScheduler | |
| bool | can_run () const noexcept |
| Reports whether at least one runnable task exists. | |
| DebugScheduler (DebugSchedulerOptions options={}) | |
| Default-construct an empty scheduler. | |
| bool | done () const noexcept |
| Check whether the runnable queue is empty. | |
| void | help_while_waiting (const WaitPredicate &is_ready) override |
| Drives one runnable task while waiting for readiness. | |
| DebugSchedulerOptions const & | options () const noexcept |
| Return the scheduler's immutable ordering configuration. | |
| void | pause () override |
| Block the scheduler from running. | |
| void | resume () override |
| Unblock the scheduler. | |
| void | run () |
| Run one batch of scheduled coroutines in the configured order. | |
| void | run_all () |
| Run until no runnable tasks remain. | |
| void | schedule (AsyncTask &&task) override |
| Enqueue a task for later run. | |
| ~DebugScheduler () | |
| Destructor. | |
Public Member Functions inherited from uni20::async::IAsyncScheduler | |
| template<class Function > requires std::invocable<Function&, std::size_t> | |
| void | execute_batch (std::size_t size, Function &&function) |
| Execute a synchronous batch of independent lightweight work items. | |
| virtual void | wait_for (const WaitPredicate &is_ready) |
Block the calling thread until is_ready returns true. | |
| virtual void | wait_for (WaitRequest const &request) |
| Block until a structured wait request becomes ready. | |
| ~IAsyncScheduler () override=default | |
| Virtual destructor. | |
Public Member Functions inherited from uni20::async::IScheduler | |
| virtual | ~IScheduler ()=default |
| Virtual destructor. | |
Public Member Functions inherited from uni20::async::ICudaScheduler | |
| ~ICudaScheduler () override=default | |
Additional Inherited Members | |
Public Types inherited from uni20::async::IAsyncScheduler | |
| using | WaitPredicate = std::function< bool()> |
| using | WaitWakeup = std::function< void()> |
| using | WaitWakeupRegistration = std::function< void(WaitWakeup)> |
Protected Member Functions inherited from uni20::async::DebugScheduler | |
| void | enqueue_task (BasicTask &&task) |
| Add one already-bound task to the runnable queue. | |
Configurable debug scheduler that admits ordinary and CUDA tasks.
All tasks share one runnable queue and the ordering policy inherited from DebugScheduler. Each CUDA activation selects the device stored in its promise and restores the calling thread's previous device when it suspends or completes.
|
inlineexplicit |
Construct with device zero as the default CUDA activation device.
|
inlineexplicit |
Construct with an explicit default CUDA activation device.
| default_device | Device used while a CUDA task has no affinity. |
| options | Deterministic runnable ordering configuration. |
|
inlineoverridevirtual |
Enqueue a task for later run.
| task | An AsyncTask bound to this scheduler. |
Implements uni20::async::IAsyncScheduler.
|
inlineoverridevirtual |
Enqueue a CUDA task without establishing device affinity.
| task | CUDA task to admit through the default device context. |
Implements uni20::async::ICudaScheduler.
|
inlineoverridevirtual |
Bind and enqueue a CUDA task for initial execution on a device.
| task | CUDA task to admit. |
| device | CUDA runtime device ordinal. |
Implements uni20::async::ICudaScheduler.