Blender  V3.3
COM_WorkScheduler.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
4 #pragma once
5 
6 #ifdef WITH_CXX_GUARDEDALLOC
7 # include "MEM_guardedalloc.h"
8 #endif
9 
10 namespace blender::compositor {
11 
12 struct WorkPackage;
13 
14 class CompositorContext;
15 
19 struct WorkScheduler {
27  static void schedule(WorkPackage *package);
28 
41  static void initialize(bool use_opencl, int num_cpu_threads);
42 
47  static void deinitialize();
48 
55  static void start(const CompositorContext &context);
56 
62  static void stop();
63 
67  static void finish();
68 
75  static bool has_gpu_devices();
76 
77  static int get_num_cpu_threads();
78 
79  static int current_thread_id();
80 
81 #ifdef WITH_CXX_GUARDEDALLOC
82  MEM_CXX_CLASS_ALLOC_FUNCS("COM:WorkScheduler")
83 #endif
84 };
85 
86 } // namespace blender::compositor
Read Guarded memory(de)allocation.
Overall context of the compositor.
contains data about work that can be scheduled
static void schedule(WorkPackage *package)
schedule a chunk of a group to be calculated. An execution group schedules a chunk in the WorkSchedul...
static void deinitialize()
deinitialize the WorkScheduler free all allocated resources
static bool has_gpu_devices()
Are there OpenCL capable GPU devices initialized? the result of this method is stored in the Composit...
static void start(const CompositorContext &context)
Start the execution this methods will start the WorkScheduler. Inside this method all threads are ini...
static void finish()
wait for all work to be completed.
static void stop()
stop the execution All created thread by the start method are destroyed.
static void initialize(bool use_opencl, int num_cpu_threads)
initialize the WorkScheduler