Definition at line 26 of file custom_pipeline.cpp.
◆ Impl()
Beatmup::CustomPipeline::Impl::Impl |
( |
| ) |
|
|
inline |
Definition at line 39 of file custom_pipeline.cpp.
bool measured
if true, the execution mode and the thread count are determined
◆ ~Impl()
virtual Beatmup::CustomPipeline::Impl::~Impl |
( |
| ) |
|
|
inlinevirtual |
Definition at line 43 of file custom_pipeline.cpp.
std::vector< TaskHolder * > tasks
the list of tasks
Beatmup::NNets::InferenceTask * task
◆ getCurrentTask() [1/2]
TaskHolder& Beatmup::CustomPipeline::Impl::getCurrentTask |
( |
| ) |
|
|
inlinevirtual |
◆ getCurrentTask() [2/2]
const TaskHolder& Beatmup::CustomPipeline::Impl::getCurrentTask |
( |
| ) |
const |
|
inlinevirtual |
◆ runTask()
void Beatmup::CustomPipeline::Impl::runTask |
( |
| ) |
|
|
inlinevirtual |
Executes the pointed task.
Implements Beatmup::TaskRouter.
Definition at line 57 of file custom_pipeline.cpp.
58 auto startTime = std::chrono::high_resolution_clock::now();
71 if (
task.executionMode != AbstractTask::TaskDeviceRequirement::CPU_ONLY &&
gpu)
84 task.executionMode != AbstractTask::TaskDeviceRequirement::CPU_ONLY &&
gpu ?
gpu :
nullptr,
88 auto endTime = std::chrono::high_resolution_clock::now();
89 task.time = std::chrono::duration<float, std::milli>(endTime - startTime).count();
void afterProcessing(ThreadIndex threadCount, GraphicPipeline *gpu, bool aborted) override
Instruction called after the task is executed.
bool process(TaskThread &thread) override
Executes the task on CPU within a given thread.
void beforeProcessing(ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu) override
Instruction called before the task is executed.
bool processOnGPU(GraphicPipeline &gpu, TaskThread &thread) override
Executes the task on GPU.
virtual void synchronize()=0
Blocks until all the other threads running the same task reach the same point.
bool abort
if true, one of threads executing the current task caused its aborting
◆ goToNextTask()
void Beatmup::CustomPipeline::Impl::goToNextTask |
( |
| ) |
|
|
inlinevirtual |
◆ allTasksDone()
bool Beatmup::CustomPipeline::Impl::allTasksDone |
( |
| ) |
const |
|
inlinevirtual |
◆ allTasksAborted()
bool Beatmup::CustomPipeline::Impl::allTasksAborted |
( |
| ) |
const |
|
inlinevirtual |
Returns true
if the current session is aborted.
Implements Beatmup::TaskRouter.
Definition at line 100 of file custom_pipeline.cpp.
virtual bool isTaskAborted() const =0
Returns true if the task is asked to stop from outside.
◆ getTaskCount()
int Beatmup::CustomPipeline::Impl::getTaskCount |
( |
| ) |
|
|
inline |
◆ getTask()
TaskHolder* Beatmup::CustomPipeline::Impl::getTask |
( |
int |
index | ) |
|
|
inline |
◆ getTaskIndex()
int Beatmup::CustomPipeline::Impl::getTaskIndex |
( |
const TaskHolder * |
holder | ) |
|
|
inline |
◆ addTask()
void Beatmup::CustomPipeline::Impl::addTask |
( |
TaskHolder * |
taskHolder | ) |
|
|
inline |
◆ insertTask()
Definition at line 130 of file custom_pipeline.cpp.
132 const auto& nextHolder = std::find(
tasks.cbegin(),
tasks.cend(), before);
133 if (nextHolder ==
tasks.cend())
134 throw RuntimeError(
"Reference task holder is not found in the task list");
Beatmup::CustomPipeline::TaskHolder * newbie
◆ removeTask()
bool Beatmup::CustomPipeline::Impl::removeTask |
( |
const TaskHolder * |
target | ) |
|
|
inline |
◆ measure()
void Beatmup::CustomPipeline::Impl::measure |
( |
| ) |
|
|
inline |
Determining execution mode (GPU or CPU) and thread count for each task.
Definition at line 152 of file custom_pipeline.cpp.
156 for (
auto& it :
tasks) {
157 switch (it->executionMode = it->getTask().getUsedDevices()) {
158 case TaskDeviceRequirement::GPU_ONLY:
161 case TaskDeviceRequirement::GPU_OR_CPU:
168 it->threadCount = it->getTask().getMaxThreads();
ThreadIndex maxThreadCount
AbstractTask::TaskDeviceRequirement executionMode
CustomPoint< numeric > max(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
◆ getUsedDevices()
Definition at line 174 of file custom_pipeline.cpp.
176 throw PipelineNotReady(
"Pipeline not measured; call measure() first.");
◆ getMaxThreads()
ThreadIndex Beatmup::CustomPipeline::Impl::getMaxThreads |
( |
| ) |
const |
|
inline |
Definition at line 180 of file custom_pipeline.cpp.
182 throw PipelineNotReady(
"Pipeline not measured; call measure() first.");
◆ beforeProcessing()
void Beatmup::CustomPipeline::Impl::beforeProcessing |
( |
GraphicPipeline * |
gpu | ) |
|
|
inline |
◆ process()
Processing entry point.
Definition at line 194 of file custom_pipeline.cpp.
208 if (!(*currentTask)->getTask().process(
thread))
ThreadIndex currentThread() const
bool allTasksAborted() const
Returns true if the current session is aborted.
bool allTasksDone() const
Returns true if all tasks are done.
return $pool getJavaReference & pipeline(index)
◆ currentTask
std::vector<TaskHolder*>::iterator Beatmup::CustomPipeline::Impl::currentTask |
|
private |
◆ tasks
std::vector<TaskHolder*> Beatmup::CustomPipeline::Impl::tasks |
|
private |
◆ tasksAccess
std::mutex Beatmup::CustomPipeline::Impl::tasksAccess |
|
private |
◆ gpu
◆ thread
◆ executionMode
◆ maxThreadCount
ThreadIndex Beatmup::CustomPipeline::Impl::maxThreadCount |
|
private |
◆ measured
bool Beatmup::CustomPipeline::Impl::measured |
|
private |
if true
, the execution mode and the thread count are determined
Definition at line 35 of file custom_pipeline.cpp.
◆ abort
bool Beatmup::CustomPipeline::Impl::abort |
|
private |
if true
, one of threads executing the current task caused its aborting
Definition at line 36 of file custom_pipeline.cpp.
The documentation for this class was generated from the following file: