|
Blender
V2.93
|
the workscheduler More...
#include <COM_WorkScheduler.h>
Static Public Member Functions | |
Public API | |
| static void | schedule (WorkPackage *package) |
| schedule a chunk of a group to be calculated. An execution group schedules a chunk in the WorkScheduler when ExecutionGroup.get_flags().open_cl is set the work will be handled by a OpenCLDevice otherwise the work is scheduled for an CPUDevice More... | |
| static void | initialize (bool use_opencl, int num_cpu_threads) |
| initialize the WorkScheduler More... | |
| static void | deinitialize () |
| deinitialize the WorkScheduler free all allocated resources More... | |
| static void | start (CompositorContext &context) |
| Start the execution this methods will start the WorkScheduler. Inside this method all threads are initialized. for every device a thread is created. More... | |
| static void | stop () |
| stop the execution All created thread by the start method are destroyed. More... | |
| static void | finish () |
| wait for all work to be completed. More... | |
| static bool | has_gpu_devices () |
| Are there OpenCL capable GPU devices initialized? the result of this method is stored in the CompositorContext A node can generate a different operation tree when OpenCLDevices exists. More... | |
| static int | current_thread_id () |
the workscheduler
Definition at line 32 of file COM_WorkScheduler.h.
|
static |
Definition at line 571 of file COM_WorkScheduler.cc.
References BLI_thread_local_get, blender::compositor::COM_threading_model(), blender::compositor::SingleThreaded, and blender::compositor::CPUDevice::thread_id().
Referenced by blender::compositor::TextureBaseOperation::executePixelSampled().
|
static |
deinitialize the WorkScheduler free all allocated resources
Definition at line 550 of file COM_WorkScheduler.cc.
References blender::compositor::COM_is_opencl_enabled(), blender::compositor::COM_threading_model(), blender::compositor::opencl_deinitialize(), blender::compositor::Queue, blender::compositor::SingleThreaded, blender::compositor::Task, and blender::compositor::threading_model_queue_deinitialize().
Referenced by COM_deinitialize().
|
static |
wait for all work to be completed.
Definition at line 479 of file COM_WorkScheduler.cc.
References blender::compositor::COM_is_opencl_enabled(), blender::compositor::COM_threading_model(), blender::compositor::opencl_finish(), blender::compositor::Queue, blender::compositor::SingleThreaded, blender::compositor::Task, blender::compositor::threading_model_queue_finish(), and blender::compositor::threading_model_task_finish().
Referenced by blender::compositor::ExecutionSystem::execute(), and blender::compositor::ExecutionGroup::execute().
|
static |
Are there OpenCL capable GPU devices initialized? the result of this method is stored in the CompositorContext A node can generate a different operation tree when OpenCLDevices exists.
Definition at line 521 of file COM_WorkScheduler.cc.
References blender::compositor::COM_is_opencl_enabled(), and blender::compositor::opencl_has_gpu_devices().
Referenced by blender::compositor::ExecutionSystem::ExecutionSystem().
|
static |
initialize the WorkScheduler
during initialization the mutexes are initialized. there are two mutexes (for every device type one) After mutex initialization the system is queried in order to count the number of CPUDevices and GPUDevices to be created. For every hardware thread a CPUDevice and for every OpenCL GPU device a OpenCLDevice is created. these devices are stored in a separate list (cpudevices & gpudevices)
This function can be called multiple times to lazily initialize OpenCL.
Definition at line 529 of file COM_WorkScheduler.cc.
References blender::compositor::COM_is_opencl_enabled(), blender::compositor::COM_threading_model(), blender::compositor::opencl_initialize(), blender::compositor::Queue, blender::compositor::SingleThreaded, blender::compositor::Task, and blender::compositor::threading_model_queue_initialize().
Referenced by COM_execute().
|
static |
schedule a chunk of a group to be calculated. An execution group schedules a chunk in the WorkScheduler when ExecutionGroup.get_flags().open_cl is set the work will be handled by a OpenCLDevice otherwise the work is scheduled for an CPUDevice
Definition at line 432 of file COM_WorkScheduler.cc.
References blender::compositor::COM_is_opencl_enabled(), blender::compositor::COM_threading_model(), blender::compositor::opencl_schedule(), blender::compositor::Queue, blender::compositor::SingleThreaded, blender::compositor::Task, blender::compositor::threading_model_queue_schedule(), blender::compositor::threading_model_single_thread_execute(), and blender::compositor::threading_model_task_schedule().
|
static |
Start the execution this methods will start the WorkScheduler. Inside this method all threads are initialized. for every device a thread is created.
Definition at line 458 of file COM_WorkScheduler.cc.
References blender::compositor::COM_is_opencl_enabled(), blender::compositor::COM_threading_model(), blender::compositor::context, blender::compositor::opencl_start(), blender::compositor::Queue, blender::compositor::SingleThreaded, blender::compositor::Task, blender::compositor::threading_model_queue_start(), and blender::compositor::threading_model_task_start().
Referenced by blender::compositor::ExecutionSystem::execute().
|
static |
stop the execution All created thread by the start method are destroyed.
Definition at line 500 of file COM_WorkScheduler.cc.
References blender::compositor::COM_is_opencl_enabled(), blender::compositor::COM_threading_model(), blender::compositor::opencl_stop(), blender::compositor::Queue, blender::compositor::SingleThreaded, blender::compositor::Task, blender::compositor::threading_model_queue_stop(), and blender::compositor::threading_model_task_stop().
Referenced by blender::compositor::ExecutionSystem::execute().