Blender
V4.3
intern
cycles
device
cpu
kernel_thread_globals.h
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2
*
3
* SPDX-License-Identifier: Apache-2.0 */
4
5
#pragma once
6
7
#include "
kernel/device/cpu/compat.h
"
8
#include "
kernel/device/cpu/globals.h
"
9
10
CCL_NAMESPACE_BEGIN
11
12
class
Profiler
;
13
14
/* A special class which extends memory ownership of the `KernelGlobalsCPU` decoupling any resource
15
* which is not thread-safe for access. Every worker thread which needs to operate on
16
* `KernelGlobalsCPU` needs to initialize its own copy of this object.
17
*
18
* NOTE: Only minimal subset of objects are copied: `KernelData` is never copied. This means that
19
* there is no unnecessary data duplication happening when using this object. */
20
class
CPUKernelThreadGlobals
:
public
KernelGlobalsCPU
{
21
public
:
22
/* TODO(sergey): Would be nice to have properly typed OSLGlobals even in the case when building
23
* without OSL support. Will avoid need to those unnamed pointers and casts. */
24
CPUKernelThreadGlobals
(
const
KernelGlobalsCPU
&kernel_globals,
25
void
*osl_globals_memory,
26
Profiler
&cpu_profiler,
27
const
int
thread_index);
28
29
~CPUKernelThreadGlobals
();
30
31
CPUKernelThreadGlobals
(
const
CPUKernelThreadGlobals
&other) =
delete
;
32
CPUKernelThreadGlobals
(
CPUKernelThreadGlobals
&&other)
noexcept
;
33
34
CPUKernelThreadGlobals
&
operator=
(
const
CPUKernelThreadGlobals
&other) =
delete
;
35
CPUKernelThreadGlobals
&
operator=
(
CPUKernelThreadGlobals
&&other);
36
37
void
start_profiling
();
38
void
stop_profiling
();
39
40
protected
:
41
void
clear_runtime_pointers
();
42
43
Profiler
&
cpu_profiler_
;
44
};
45
46
CCL_NAMESPACE_END
CPUKernelThreadGlobals
Definition
kernel_thread_globals.h:20
CPUKernelThreadGlobals::operator=
CPUKernelThreadGlobals & operator=(const CPUKernelThreadGlobals &other)=delete
CPUKernelThreadGlobals::stop_profiling
void stop_profiling()
Definition
kernel_thread_globals.cpp:86
CPUKernelThreadGlobals::start_profiling
void start_profiling()
Definition
kernel_thread_globals.cpp:81
CPUKernelThreadGlobals::~CPUKernelThreadGlobals
~CPUKernelThreadGlobals()
Definition
kernel_thread_globals.cpp:39
CPUKernelThreadGlobals::CPUKernelThreadGlobals
CPUKernelThreadGlobals(const CPUKernelThreadGlobals &other)=delete
CPUKernelThreadGlobals::cpu_profiler_
Profiler & cpu_profiler_
Definition
kernel_thread_globals.h:43
CPUKernelThreadGlobals::CPUKernelThreadGlobals
CPUKernelThreadGlobals(const KernelGlobalsCPU &kernel_globals, void *osl_globals_memory, Profiler &cpu_profiler, const int thread_index)
Definition
kernel_thread_globals.cpp:13
CPUKernelThreadGlobals::clear_runtime_pointers
void clear_runtime_pointers()
Definition
kernel_thread_globals.cpp:65
Profiler
Definition
util/profiling.h:72
compat.h
globals.h
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition
device/cuda/compat.h:10
CCL_NAMESPACE_BEGIN
Definition
python.cpp:44
KernelGlobalsCPU
Definition
device/cpu/globals.h:40
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0