NEML2 2.0.0
|
A very simple scheduler. More...
A very simple scheduler.
This schedule is simple in the sense that
#include <SimpleScheduler.h>
Public Member Functions | |
SimpleScheduler (const OptionSet &options) | |
Construct a new WorkScheduler object. | |
std::vector< Device > | devices () const override |
Device options. | |
![]() | |
WorkScheduler (const OptionSet &options) | |
Construct a new WorkScheduler object. | |
void | schedule_work (Device &, std::size_t &) |
Determine the device and batch size for the next dispatch. | |
void | dispatched_work (Device, std::size_t) |
Update the scheduler with the dispatch of the last batch. | |
void | completed_work (Device, std::size_t) |
Update the scheduler with the completion of the last batch. | |
void | wait_for_completion () |
Wait for all work to complete. | |
![]() | |
NEML2Object ()=delete | |
NEML2Object (NEML2Object &&)=delete | |
NEML2Object (const NEML2Object &)=delete | |
NEML2Object & | operator= (NEML2Object &&)=delete |
NEML2Object & | operator= (const NEML2Object &)=delete |
virtual | ~NEML2Object ()=default |
NEML2Object (const OptionSet &options) | |
Construct a new NEML2Object object. | |
const OptionSet & | input_options () const |
virtual void | setup () |
Setup this object. | |
const std::string & | name () const |
A readonly reference to the object's name. | |
const std::string & | type () const |
A readonly reference to the object's type. | |
const std::string & | path () const |
A readonly reference to the object's path. | |
const std::string & | doc () const |
A readonly reference to the object's docstring. | |
template<typename T = NEML2Object> | |
const T * | host () const |
Get a readonly pointer to the host. | |
template<typename T = NEML2Object> | |
T * | host () |
Get a writable pointer to the host. | |
Static Public Member Functions | |
static OptionSet | expected_options () |
Options for the scheduler. | |
![]() | |
static OptionSet | expected_options () |
Options for the scheduler. | |
![]() | |
static OptionSet | expected_options () |
Protected Member Functions | |
bool | schedule_work_impl (Device &, std::size_t &) const override |
Implementation of the work scheduling. | |
void | dispatched_work_impl (Device, std::size_t) override |
Update the scheduler with the dispatch of the last batch. | |
void | completed_work_impl (Device, std::size_t) override |
Update the scheduler with the completion of the last batch. | |
bool | all_work_completed () const override |
Check if all work has been completed. | |
Additional Inherited Members | |
![]() | |
std::condition_variable | _condition |
Condition variable for the scheduling thread. | |
SimpleScheduler | ( | const OptionSet & | options | ) |
Construct a new WorkScheduler object.
options | Options for the scheduler |
|
overrideprotectedvirtual |
Check if all work has been completed.
Implements WorkScheduler.
|
overrideprotectedvirtual |
Update the scheduler with the completion of the last batch.
Implements WorkScheduler.
|
inlineoverridevirtual |
Device options.
Reimplemented from WorkScheduler.
|
overrideprotectedvirtual |
Update the scheduler with the dispatch of the last batch.
Implements WorkScheduler.
|
static |
Options for the scheduler.
|
overrideprotectedvirtual |
Implementation of the work scheduling.
Implements WorkScheduler.