6#include <Common/assertion.h>
7#include <Common/primitive_type.h>
41 void scheduleAll(std::vector<WorkUnit>& out_workUnits);
61 virtual void scheduleOne(
WorkUnit* out_workUnit) = 0;
71 m_numWorkers (numWorkers),
72 m_totalWorkUnit (totalWorkUnit),
73 m_totalVolume (totalWorkUnit.getVolume()),
77 PH_ASSERT_GE(numWorkers, 1);
87 PH_ASSERT(out_workUnit);
91 scheduleOne(out_workUnit);
93 const std::size_t volume = out_workUnit->
getVolume();
110 out_workUnits.push_back(workUnit);
A manager that distributes work.
Definition IWorkDispatcher.h:14
A manager that distributes a fixed amount of work to workers.
Definition WorkScheduler.h:21
std::size_t m_scheduledVolume
Definition WorkScheduler.h:57
bool schedule(WorkUnit *out_workUnit)
Get some amount of work.
Definition WorkScheduler.h:85
WorkUnit m_totalWorkUnit
Definition WorkScheduler.h:55
std::size_t m_totalVolume
Definition WorkScheduler.h:56
std::size_t m_submittedVolume
Definition WorkScheduler.h:58
float getScheduledFraction() const
Definition WorkScheduler.h:121
WorkScheduler()
A scheduler with no work load.
Definition WorkScheduler.h:66
void scheduleAll(std::vector< WorkUnit > &out_workUnits)
Definition WorkScheduler.h:105
bool isExhausted() const
Checks if all works had been scheduled.
Definition WorkScheduler.h:131
float getSubmittedFraction() const
Definition WorkScheduler.h:126
bool dispatch(WorkUnit *out_workUnit) override
Get some amount of work.
Definition WorkScheduler.h:80
std::size_t m_numWorkers
Definition WorkScheduler.h:54
void submit(const WorkUnit &workUnit)
Definition WorkScheduler.h:114
Represents some amount of work.
Definition WorkUnit.h:17
std::size_t getVolume() const
Definition WorkUnit.h:82
The root for all renderer implementations.
Definition EEngineProject.h:6