Blender
V3.3
|
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 (const 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 | get_num_cpu_threads () |
static int | current_thread_id () |
the workscheduler
Definition at line 19 of file COM_WorkScheduler.h.
|
static |
Definition at line 563 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::execute_pixel_sampled(), and blender::compositor::TextureBaseOperation::update_memory_buffer_partial().
|
static |
deinitialize the WorkScheduler free all allocated resources
Definition at line 537 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 465 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::TiledExecutionModel::execute(), blender::compositor::ExecutionGroup::execute(), and blender::compositor::ExecutionSystem::execute_work().
|
static |
Definition at line 558 of file COM_WorkScheduler.cc.
References blender::compositor::g_work_scheduler.
Referenced by blender::compositor::ExecutionSystem::ExecutionSystem().
|
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 507 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().
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 515 of file COM_WorkScheduler.cc.
References blender::compositor::COM_is_opencl_enabled(), blender::compositor::COM_threading_model(), blender::compositor::g_work_scheduler, blender::compositor::num_cpu_threads, 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 418 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().
Referenced by blender::compositor::ExecutionSystem::execute_work().
|
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 444 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::TiledExecutionModel::execute(), and blender::compositor::ConstantFolder::fold_operations().
|
static |
stop the execution All created thread by the start method are destroyed.
Definition at line 486 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::TiledExecutionModel::execute(), and blender::compositor::ConstantFolder::fold_operations().