20 #include "../parallelism.h"
21 #include "../exception.h"
Task: an operation that can be executed by multiple threads in parallel.
TaskDeviceRequirement
Specifies which device (CPU and/or GPU) is used to run the task.
PipelineNotReady(const char *message)
A task within a pipeline.
void operator=(const TaskHolder &)=delete
TaskHolder(AbstractTask &task)
AbstractTask & getTask() const
AbstractTask::TaskDeviceRequirement executionMode
Custom pipeline: a sequence of tasks to be executed as a whole.
bool removeTask(const TaskHolder &task)
Removes a task from the pipeline.
TaskDeviceRequirement getUsedDevices() const
Communicates devices (CPU and/or GPU) the task is run on.
void afterProcessing(ThreadIndex threadCount, GraphicPipeline *gpu, bool aborted)
Instruction called after the task is executed.
TaskHolder & getTask(int) const
Retrieves a task by its index.
int getTaskIndex(const TaskHolder &)
Retrieves task index if it is in the pipeline; returns -1 otherwise.
TaskHolder & insertTask(AbstractTask &task, const TaskHolder &before)
Inserts a task in a specified position of the pipeline before another task.
TaskHolder & addTask(AbstractTask &)
Adds a new task to the end of the pipeline.
bool processOnGPU(GraphicPipeline &gpu, TaskThread &thread)
Executes the task on GPU.
virtual bool route(TaskRouter &router)=0
bool process(TaskThread &thread)
Executes the task on CPU within a given thread.
ThreadIndex getMaxThreads() const
Gives the upper limint on the number of threads the task may be performed by.
void measure()
Determines pipeline execution mode and required thread count.
virtual TaskHolder * createTaskHolder(AbstractTask &task)=0
void beforeProcessing(ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu)
Instruction called before the task is executed.
Base class for all exceptions.
Internal low-level GPU control API.
Beatmup object base class
Interface managing the execution of a sequence of tasks.
virtual void goToNextTask()=0
Goes to the next task in the list.
virtual const CustomPipeline::TaskHolder & getCurrentTask() const =0
virtual void runTask()=0
Executes the pointed task.
virtual CustomPipeline::TaskHolder & getCurrentTask()=0
Returns currently pointed task.
virtual bool allTasksDone() const =0
Returns true if all tasks are done.
virtual bool allTasksAborted() const =0
Returns true if the current session is aborted.
bool operator==(const CustomRectangle< numeric > &lhs, const CustomRectangle< numeric > &rhs)
Checks whether two rectangles are actually the same.
unsigned char ThreadIndex
number of threads / thread index
Beatmup::NNets::InferenceTask * task