Blender V5.3
debug.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#include "util/debug.h"
6
7#include <cstdlib>
8
9#include "util/log.h"
10
12
17
19{
20#define STRINGIFY(x) #x
21#define CHECK_CPU_FLAGS(flag, env) \
22 do { \
23 flag = (getenv(env) == nullptr); \
24 if (!flag) { \
25 LOG_INFO << "Disabling " << STRINGIFY(flag) << " instruction set."; \
26 } \
27 } while (0)
28
29 CHECK_CPU_FLAGS(avx2, "CYCLES_CPU_NO_AVX2");
30
31#undef STRINGIFY
32#undef CHECK_CPU_FLAGS
33
35}
36
41
46
51
53{
54 if (getenv("CYCLES_CUDA_ADAPTIVE_COMPILE") != nullptr) {
55 adaptive_compile = true;
56 }
57
58 if (const char *str = getenv("CYCLES_CUDA_LOCAL_ATOMIC_SORT")) {
59 use_local_atomic_sort = (atoi(str) != 0);
60 }
61}
62
64{
65 if (getenv("CYCLES_HIP_ADAPTIVE_COMPILE") != nullptr) {
66 adaptive_compile = true;
67 }
68}
69
71{
72 if (getenv("CYCLES_METAL_ADAPTIVE_COMPILE") != nullptr) {
73 adaptive_compile = true;
74 }
75
76 if (const char *str = getenv("CYCLES_METAL_LOCAL_ATOMIC_SORT")) {
77 use_local_atomic_sort = (atoi(str) != 0);
78 }
79
80 if (const char *str = getenv("CYCLES_METAL_NANOVDB")) {
81 use_nanovdb = (atoi(str) != 0);
82 }
83
84 if (const char *str = getenv("CYCLES_METAL_ASYNC_PSO_CREATION")) {
85 use_async_pso_creation = (atoi(str) != 0);
86 }
87
88 if (const char *str = getenv("CYCLES_METALRT_PCMI")) {
89 use_metalrt_pcmi = (atoi(str) != 0);
90 }
91
92 if (const char *str = getenv("CYCLES_METAL_RESIDENCY_SETS")) {
94 }
95}
96
101
103{
104 use_eviction = true;
105 preserve_unused = 0;
106 min_tile_size = 64;
107}
108
113
115{
116 use_debug = false;
117}
118
120{
121 cpu.reset();
122 cuda.reset();
123 optix.reset();
124 metal.reset();
126}
127
CPU cpu
Definition debug.h:143
void reset()
Definition debug.cpp:119
OptiX optix
Definition debug.h:149
CUDA cuda
Definition debug.h:146
TextureCache texture_cache
Definition debug.h:158
Metal metal
Definition debug.h:155
#define CHECK_CPU_FLAGS(flag, env)
#define CCL_NAMESPACE_END
#define str(s)
@ BVH_LAYOUT_AUTO
void reset()
Definition debug.cpp:18
BVHLayout bvh_layout
Definition debug.h:47
bool adaptive_compile
Definition debug.h:59
bool use_local_atomic_sort
Definition debug.h:62
bool adaptive_compile
Definition debug.h:73
void reset()
Definition debug.cpp:63
bool use_async_pso_creation
Definition debug.h:105
bool use_metalrt_pcmi
Definition debug.h:108
bool adaptive_compile
Definition debug.h:96
bool use_residency_sets_if_available
Definition debug.h:111
bool use_local_atomic_sort
Definition debug.h:99