Blender  V3.3
kernel_thread_globals.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #pragma once
5 
8 
10 
11 class Profiler;
12 
13 /* A special class which extends memory ownership of the `KernelGlobalsCPU` decoupling any resource
14  * which is not thread-safe for access. Every worker thread which needs to operate on
15  * `KernelGlobalsCPU` needs to initialize its own copy of this object.
16  *
17  * NOTE: Only minimal subset of objects are copied: `KernelData` is never copied. This means that
18  * there is no unnecessary data duplication happening when using this object. */
20  public:
21  /* TODO(sergey): Would be nice to have properly typed OSLGlobals even in the case when building
22  * without OSL support. Will avoid need to those unnamed pointers and casts. */
24  void *osl_globals_memory,
25  Profiler &cpu_profiler);
26 
28 
31 
34 
35  void start_profiling();
36  void stop_profiling();
37 
38  protected:
39  void reset_runtime_memory();
40 
42 };
43 
CPUKernelThreadGlobals(const KernelGlobalsCPU &kernel_globals, void *osl_globals_memory, Profiler &cpu_profiler)
CPUKernelThreadGlobals & operator=(const CPUKernelThreadGlobals &other)=delete
CPUKernelThreadGlobals(const CPUKernelThreadGlobals &other)=delete
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
SyclQueue void void size_t num_bytes SyclQueue void * kernel_globals