|
Uni20
Asynchronous tensor and runtime library.
|
Unified oneTBB scheduler with one host arena and one arena per CUDA device. More...
#include <tbb_cuda_scheduler.hpp>
Public Member Functions | |
| bool | has_device (int device) const noexcept |
| Report whether a CUDA device has an execution arena in this scheduler. | |
| TbbCudaScheduler & | operator= (TbbCudaScheduler const &)=delete |
| void | schedule (AsyncTask &&t) override |
| Schedule a coroutine for initial execution. | |
| void | schedule (CudaTask &&task) override |
| Submit a CUDA task without establishing device affinity. | |
| void | schedule (CudaTask &&task, int device) override |
| Bind and submit a CUDA task to an enrolled device arena. | |
| TbbCudaScheduler (std::vector< cuda::Device > devices, TbbCudaSchedulerOptions options={}) | |
| Construct a scheduler for an explicit set of CUDA devices. | |
| TbbCudaScheduler (TbbCudaScheduler const &)=delete | |
| TbbCudaScheduler (TbbCudaSchedulerOptions options={}) | |
| Construct a scheduler enrolling every visible CUDA device. | |
| ~TbbCudaScheduler () noexcept override | |
Public Member Functions inherited from uni20::async::TbbScheduler | |
| void | help_while_waiting (const WaitPredicate &is_ready) override |
| Allow a scheduler to advance queued work while a thread is blocking. | |
| void | pause () override |
| Pause the scheduler. Don't execute scheduled tasks, but instead add them to a queue. | |
| void | resume () override |
| Unpause the scheduler, and execute any tasks that have been queued. | |
| void | run_all () |
| Block until all tasks scheduled on this scheduler are complete. | |
| void | schedule (AsyncTask &&t) override |
| Schedule a coroutine for initial execution. | |
| TbbScheduler (int max_concurrency=oneapi::tbb::task_arena::automatic, TbbSchedulerBatchOptions batch_options={}) | |
| Construct a TBB scheduler with a given arena concurrency. | |
| TbbScheduler (oneapi::tbb::task_arena::constraints constraints, TbbSchedulerBatchOptions batch_options={}) | |
| Construct a TBB scheduler constrained to a specific NUMA node. | |
| void | wait_for (const WaitPredicate &is_ready) override |
| Accept an already-satisfied predicate; pending TBB waits require a WaitRequest notification. | |
| void | wait_for (WaitRequest const &request) override |
| Wait for targeted readiness while allowing the arena to execute other work. | |
| ~TbbScheduler () noexcept override | |
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. | |
| ~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::TbbScheduler | |
| template<typename Prepare > | |
| void | dispatch_handle_in_arena (oneapi::tbb::task_arena &arena, TaskHandle handle, detail::TbbTaskAdmissionContext context, Prepare &&prepare) |
| Submit one activation to an arena through the shared task group. | |
| void | enqueue_task (BasicTask &&t) |
| Enqueue one task through the scheduler's domain-routing hook. | |
| void | wait_for_submitted_tasks () |
| Wait for every activation registered with the shared task group. | |
Unified oneTBB scheduler with one host arena and one arena per CUDA device.
Ordinary and CUDA tasks share scheduler ownership, task-group accounting, pause state, waits, and rescheduling. CUDA activations are routed by the promise's optional affinity or the scheduler's default CUDA device.
|
inlineexplicit |
Construct a scheduler enrolling every visible CUDA device.
| options | Host and per-device arena configuration. |
|
inlineexplicit |
Construct a scheduler for an explicit set of CUDA devices.
| devices | Validated devices to enroll. |
| options | Host and per-device arena configuration. |
|
delete |
|
inlineoverridenoexcept |
|
inlinenoexcept |
Report whether a CUDA device has an execution arena in this scheduler.
|
delete |
|
inlineoverridevirtual |
Schedule a coroutine for initial execution.
Implements uni20::async::IAsyncScheduler.
|
inlineoverridevirtual |
Submit a CUDA task without establishing device affinity.
| task | CUDA task to admit through the default device arena. |
Implements uni20::async::ICudaScheduler.
|
inlineoverridevirtual |
Bind and submit a CUDA task to an enrolled device arena.
| task | CUDA task to admit. |
| device | CUDA runtime device ordinal selected for the task. |
Implements uni20::async::ICudaScheduler.