Blender V4.3
device/cpu/device.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 "device/cpu/device.h"
8
9/* Used for `info.denoisers`. */
10/* TODO(sergey): The denoisers are probably to be moved completely out of the device into their
11 * own class. But until then keep API consistent with how it used to work before. */
12#include "util/guiding.h"
14
16
17Device *device_cpu_create(const DeviceInfo &info, Stats &stats, Profiler &profiler, bool headless)
18{
19 return new CPUDevice(info, stats, profiler, headless);
20}
21
23{
24 DeviceInfo info;
25
26 info.type = DEVICE_CPU;
28 info.id = "CPU";
29 info.num = 0;
30 info.has_osl = true;
31 info.has_nanovdb = true;
32 info.has_profiling = true;
33 if (guiding_supported()) {
34 info.has_guiding = true;
35 }
36 else {
37 info.has_guiding = false;
38 }
41 }
42
43 devices.insert(devices.begin(), info);
44}
45
47{
48 string capabilities = "";
49 capabilities += system_cpu_support_sse42() ? "SSE42 " : "";
50 capabilities += system_cpu_support_avx2() ? "AVX2" : "";
51 if (capabilities[capabilities.size() - 1] == ' ') {
52 capabilities.resize(capabilities.size() - 1);
53 }
54 return capabilities;
55}
56
DenoiserTypeMask denoisers
bool has_profiling
DeviceType type
string description
@ DENOISER_OPENIMAGEDENOISE
Definition denoise.h:15
CCL_NAMESPACE_BEGIN Device * device_cpu_create(const DeviceInfo &info, Stats &stats, Profiler &profiler, bool headless)
void device_cpu_info(vector< DeviceInfo > &devices)
string device_cpu_capabilities()
#define CCL_NAMESPACE_END
@ DEVICE_CPU
static CCL_NAMESPACE_BEGIN bool openimagedenoise_supported()
bool system_cpu_support_avx2()
Definition system.cpp:227
bool system_cpu_support_sse42()
Definition system.cpp:222
string system_cpu_brand_string()
Definition system.cpp:71
static bool guiding_supported()