Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/device.cpp
| Show All 14 Lines | |||||
| */ | */ | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "bvh/bvh2.h" | #include "bvh/bvh2.h" | ||||
| #include "device/device.h" | #include "device/device.h" | ||||
| #include "device/device_queue.h" | #include "device/queue.h" | ||||
| #include "device/cpu/device.h" | #include "device/cpu/device.h" | ||||
| #include "device/cuda/device.h" | #include "device/cuda/device.h" | ||||
| #include "device/dummy/device.h" | #include "device/dummy/device.h" | ||||
| #include "device/hip/device.h" | #include "device/hip/device.h" | ||||
| #include "device/multi/device.h" | #include "device/multi/device.h" | ||||
| #include "device/optix/device.h" | #include "device/optix/device.h" | ||||
| #include "util/util_foreach.h" | #include "util/foreach.h" | ||||
| #include "util/util_half.h" | #include "util/half.h" | ||||
| #include "util/util_logging.h" | #include "util/log.h" | ||||
| #include "util/util_math.h" | #include "util/math.h" | ||||
| #include "util/util_string.h" | #include "util/string.h" | ||||
| #include "util/util_system.h" | #include "util/system.h" | ||||
| #include "util/util_time.h" | #include "util/time.h" | ||||
| #include "util/util_types.h" | #include "util/types.h" | ||||
| #include "util/util_vector.h" | #include "util/vector.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| bool Device::need_types_update = true; | bool Device::need_types_update = true; | ||||
| bool Device::need_devices_update = true; | bool Device::need_devices_update = true; | ||||
| thread_mutex Device::device_mutex; | thread_mutex Device::device_mutex; | ||||
| vector<DeviceInfo> Device::cuda_devices; | vector<DeviceInfo> Device::cuda_devices; | ||||
| vector<DeviceInfo> Device::optix_devices; | vector<DeviceInfo> Device::optix_devices; | ||||
| Show All 17 Lines | void Device::build_bvh(BVH *bvh, Progress &progress, bool refit) | ||||
| } | } | ||||
| else { | else { | ||||
| bvh2->build(progress, &stats); | bvh2->build(progress, &stats); | ||||
| } | } | ||||
| } | } | ||||
| Device *Device::create(const DeviceInfo &info, Stats &stats, Profiler &profiler) | Device *Device::create(const DeviceInfo &info, Stats &stats, Profiler &profiler) | ||||
| { | { | ||||
| #ifdef WITH_MULTI | |||||
| if (!info.multi_devices.empty()) { | if (!info.multi_devices.empty()) { | ||||
| /* Always create a multi device when info contains multiple devices. | /* Always create a multi device when info contains multiple devices. | ||||
| * This is done so that the type can still be e.g. DEVICE_CPU to indicate | * This is done so that the type can still be e.g. DEVICE_CPU to indicate | ||||
| * that it is a homogeneous collection of devices, which simplifies checks. */ | * that it is a homogeneous collection of devices, which simplifies checks. */ | ||||
| return device_multi_create(info, stats, profiler); | return device_multi_create(info, stats, profiler); | ||||
| } | } | ||||
| #endif | |||||
| Device *device = NULL; | Device *device = NULL; | ||||
| switch (info.type) { | switch (info.type) { | ||||
| case DEVICE_CPU: | case DEVICE_CPU: | ||||
| device = device_cpu_create(info, stats, profiler); | device = device_cpu_create(info, stats, profiler); | ||||
| break; | break; | ||||
| #ifdef WITH_CUDA | #ifdef WITH_CUDA | ||||
| ▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines | |||||