Blender  V3.3
device/cpu/device.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #include "device/cpu/device.h"
6 
7 /* Used for `info.denoisers`. */
8 /* TODO(sergey): The denoisers are probably to be moved completely out of the device into their
9  * own class. But until then keep API consistent with how it used to work before. */
10 #include "util/openimagedenoise.h"
11 
13 
14 Device *device_cpu_create(const DeviceInfo &info, Stats &stats, Profiler &profiler)
15 {
16  return new CPUDevice(info, stats, profiler);
17 }
18 
20 {
21  DeviceInfo info;
22 
23  info.type = DEVICE_CPU;
25  info.id = "CPU";
26  info.num = 0;
27  info.has_osl = true;
28  info.has_nanovdb = true;
29  info.has_profiling = true;
32  }
33 
34  devices.insert(devices.begin(), info);
35 }
36 
38 {
39  string capabilities = "";
40  capabilities += system_cpu_support_sse2() ? "SSE2 " : "";
41  capabilities += system_cpu_support_sse3() ? "SSE3 " : "";
42  capabilities += system_cpu_support_sse41() ? "SSE41 " : "";
43  capabilities += system_cpu_support_avx() ? "AVX " : "";
44  capabilities += system_cpu_support_avx2() ? "AVX2" : "";
45  if (capabilities[capabilities.size() - 1] == ' ')
46  capabilities.resize(capabilities.size() - 1);
47  return capabilities;
48 }
49 
DenoiserTypeMask denoisers
Definition: device/device.h:73
bool has_nanovdb
Definition: device/device.h:67
bool has_profiling
Definition: device/device.h:69
DeviceType type
Definition: device/device.h:62
string description
Definition: device/device.h:63
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
@ DENOISER_OPENIMAGEDENOISE
Definition: denoise.h:14
void device_cpu_info(vector< DeviceInfo > &devices)
CCL_NAMESPACE_BEGIN Device * device_cpu_create(const DeviceInfo &info, Stats &stats, Profiler &profiler)
string device_cpu_capabilities()
@ DEVICE_CPU
Definition: device/device.h:38
Vector< CPUDevice > devices
list of all CPUDevices. for every hardware thread an instance of CPUDevice is created
static CCL_NAMESPACE_BEGIN bool openimagedenoise_supported()
bool system_cpu_support_avx2()
Definition: system.cpp:251
string system_cpu_brand_string()
Definition: system.cpp:70
bool system_cpu_support_avx()
Definition: system.cpp:247
bool system_cpu_support_sse3()
Definition: system.cpp:237
bool system_cpu_support_sse41()
Definition: system.cpp:242
bool system_cpu_support_sse2()
Definition: system.cpp:232