Blender
V3.3
|
#include <device.h>
Public Member Functions | |
virtual | ~Device () noexcept(false) |
virtual const string & | error_message () |
bool | have_error () |
virtual void | set_error (const string &error) |
virtual BVHLayoutMask | get_bvh_layout_mask () const =0 |
virtual void | const_copy_to (const char *name, void *host, size_t size)=0 |
virtual bool | load_kernels (uint) |
virtual unique_ptr< DeviceQueue > | gpu_queue_create () |
virtual void | get_cpu_kernel_thread_globals (vector< CPUKernelThreadGlobals > &) |
virtual void * | get_cpu_osl_memory () |
virtual void | build_bvh (BVH *bvh, Progress &progress, bool refit) |
virtual void | release_optix_bvh (BVH *) |
virtual int | device_number (Device *) |
virtual void | optimize_for_scene (Scene *) |
virtual bool | is_resident (device_ptr, Device *sub_device) |
virtual bool | check_peer_access (Device *) |
virtual bool | should_use_graphics_interop () |
virtual bool | denoise_buffer (const DeviceDenoiseTask &) |
virtual DeviceQueue * | get_denoise_queue () |
virtual void | foreach_device (const function< void(Device *)> &callback) |
Static Public Member Functions | |
static const CPUKernels & | get_cpu_kernels () |
static Device * | create (const DeviceInfo &info, Stats &stats, Profiler &profiler) |
static DeviceType | type_from_string (const char *name) |
static string | string_from_type (DeviceType type) |
static vector< DeviceType > | available_types () |
static vector< DeviceInfo > | available_devices (uint device_type_mask=DEVICE_MASK_ALL) |
static DeviceInfo | dummy_device (const string &error_msg="") |
static string | device_capabilities (uint device_type_mask=DEVICE_MASK_ALL) |
static DeviceInfo | get_multi_device (const vector< DeviceInfo > &subdevices, int threads, bool background) |
static void | tag_update () |
static void | free_memory () |
Public Attributes | |
DeviceInfo | info |
Stats & | stats |
Profiler & | profiler |
Protected Member Functions | |
Device (const DeviceInfo &info_, Stats &stats_, Profiler &profiler_) | |
virtual device_ptr | mem_alloc_sub_ptr (device_memory &, size_t, size_t) |
virtual void | mem_free_sub_ptr (device_ptr) |
virtual void | mem_alloc (device_memory &mem)=0 |
virtual void | mem_copy_to (device_memory &mem)=0 |
virtual void | mem_copy_from (device_memory &mem, size_t y, size_t w, size_t h, size_t elem)=0 |
virtual void | mem_zero (device_memory &mem)=0 |
virtual void | mem_free (device_memory &mem)=0 |
Protected Attributes | |
string | error_msg |
Friends | |
class | device_sub_ptr |
class | MultiDevice |
class | DeviceServer |
class | device_memory |
Definition at line 105 of file device/device.h.
|
inlineprotected |
Definition at line 109 of file device/device.h.
|
virtualnoexcept |
Definition at line 48 of file device/device.cpp.
|
static |
Definition at line 186 of file device/device.cpp.
References device_cpu_info(), device_cuda_info(), device_cuda_init(), device_hip_info(), device_hip_init(), DEVICE_MASK_CPU, DEVICE_MASK_CUDA, DEVICE_MASK_HIP, DEVICE_MASK_METAL, DEVICE_MASK_ONEAPI, DEVICE_MASK_OPTIX, device_metal_info(), device_metal_init(), device_oneapi_info(), device_oneapi_init(), device_optix_info(), device_optix_init(), blender::compositor::devices, info, lock, and mask().
Referenced by available_devices_func(), blender_device_info(), Denoiser::create(), create_denoiser_device(), BlenderSync::get_denoise_params(), and options_parse().
|
static |
Definition at line 164 of file device/device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_HIP, DEVICE_METAL, DEVICE_ONEAPI, DEVICE_OPTIX, and types.
Referenced by get_device_types_func(), and options_parse().
Reimplemented in MultiDevice, and CPUDevice.
Definition at line 52 of file device/device.cpp.
References BVH2::build(), BVHParams::bvh_layout, BVH_LAYOUT_BVH2, BVH::params, refit(), BVH2::refit(), and stats.
Referenced by CPUDevice::build_bvh(), MultiDevice::build_bvh(), Geometry::compute_bvh(), and GeometryManager::device_update_bvh().
Definition at line 201 of file device/device.h.
Referenced by MultiDevice::MultiDevice().
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by MultiDevice::const_copy_to(), Scene::device_update(), PathTraceWorkGPU::init_execution(), and shade_background_pixels().
|
static |
Definition at line 65 of file device/device.cpp.
References DEVICE_CPU, device_cpu_create(), DEVICE_CUDA, device_cuda_create(), device_cuda_init(), device_dummy_create(), DEVICE_HIP, device_hip_create(), device_hip_init(), DEVICE_METAL, device_metal_create(), device_metal_init(), device_multi_create(), DEVICE_ONEAPI, device_oneapi_create(), DEVICE_OPTIX, device_optix_create(), device_optix_init(), info, DeviceInfo::multi_devices, NULL, profiler, stats, and DeviceInfo::type.
Referenced by create_denoiser_device(), DenoiserPipeline::DenoiserPipeline(), MultiDevice::MultiDevice(), Session::Session(), and RenderGraph::SetUp().
|
inlinevirtual |
Definition at line 223 of file device/device.h.
References LOG.
Referenced by DeviceDenoiser::denoise_buffer().
|
static |
Definition at line 287 of file device/device.cpp.
References device_cpu_capabilities(), device_cuda_capabilities(), device_cuda_init(), device_hip_capabilities(), device_hip_init(), DEVICE_MASK_CPU, DEVICE_MASK_CUDA, DEVICE_MASK_HIP, DEVICE_MASK_METAL, DEVICE_MASK_ONEAPI, device_metal_capabilities(), device_metal_init(), device_oneapi_capabilities(), device_oneapi_init(), lock, and mask().
Referenced by system_info_func().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 185 of file device/device.h.
|
static |
Definition at line 279 of file device/device.cpp.
References DEVICE_DUMMY, DeviceInfo::error_msg, error_msg, info, and DeviceInfo::type.
Referenced by blender_device_info().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 130 of file device/device.h.
References error_msg.
Referenced by MultiDevice::error_message(), have_error(), Scene::load_kernels(), Session::run_main_render_loop(), and Session::Session().
Reimplemented in MultiDevice.
Definition at line 240 of file device/device.h.
References callback.
Referenced by ShaderEval::eval(), find_best_device(), MultiDevice::foreach_device(), and PathTrace::PathTrace().
|
static |
Definition at line 416 of file device/device.cpp.
References vector< value_type, allocator_type >::free_memory().
Referenced by exit_func(), and tag_update().
|
pure virtual |
Implemented in MultiDevice, DummyDevice, and CPUDevice.
Referenced by Geometry::compute_bvh(), GeometryManager::device_update_bvh(), ObjectManager::device_update_prim_offsets(), MultiDevice::get_bvh_layout_mask(), and PathTraceWorkGPU::render_samples().
|
virtual |
Reimplemented in CPUDevice.
Definition at line 440 of file device/device.cpp.
References LOG.
Referenced by ShaderEval::eval_cpu(), and PathTraceWorkCPU::init_execution().
|
static |
Definition at line 433 of file device/device.cpp.
Referenced by CPUDevice::CPUDevice(), and ShaderEval::eval_cpu().
|
virtual |
Reimplemented in MultiDevice, and CPUDevice.
Definition at line 446 of file device/device.cpp.
Referenced by GeometryManager::device_free(), and GeometryManager::update_osl_attributes().
|
inlinevirtual |
Definition at line 229 of file device/device.h.
References LOG.
Referenced by DeviceDenoiser::denoise_buffer().
|
static |
Definition at line 336 of file device/device.cpp.
References DeviceInfo::cpu_threads, DENOISER_ALL, DeviceInfo::denoisers, DeviceInfo::description, DEVICE_CPU, DEVICE_MULTI, DEVICE_NONE, DeviceInfo::has_nanovdb, DeviceInfo::has_osl, DeviceInfo::has_peer_memory, DeviceInfo::has_profiling, DeviceInfo::id, info, max, TaskScheduler::max_concurrency(), DeviceInfo::multi_devices, DeviceInfo::num, blender::compositor::threads, DeviceInfo::type, DeviceInfo::use_metalrt, and VLOG_INFO.
Referenced by blender_device_info().
|
virtual |
Definition at line 427 of file device/device.cpp.
References LOG.
Referenced by ShaderEval::eval_gpu().
|
inline |
Definition at line 134 of file device/device.h.
References error_message().
Referenced by PathTraceWorkGPU::copy_to_display(), Scene::device_update(), Session::run_main_render_loop(), Session::Session(), and set_error().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 195 of file device/device.h.
Referenced by device_memory::is_resident().
Reimplemented in CPUDevice, and MultiDevice.
Definition at line 156 of file device/device.h.
Referenced by DenoiserPipeline::DenoiserPipeline(), MultiDevice::load_kernels(), and Scene::load_kernels().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_alloc(), and MultiDevice::mem_alloc().
|
inlineprotectedvirtual |
Reimplemented in CPUDevice.
Definition at line 116 of file device/device.h.
Referenced by device_sub_ptr::device_sub_ptr().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_copy_from(), and MultiDevice::mem_copy_from().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_copy_to(), and MultiDevice::mem_copy_to().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_free(), and MultiDevice::mem_free().
|
inlineprotectedvirtual |
Definition at line 122 of file device/device.h.
Referenced by device_sub_ptr::~device_sub_ptr().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_zero(), and MultiDevice::mem_zero().
Definition at line 191 of file device/device.h.
Referenced by Scene::device_update().
Definition at line 182 of file device/device.h.
|
inlinevirtual |
Definition at line 138 of file device/device.h.
References error(), error_msg, and have_error().
Referenced by OIDNDenoiser::ensure_denoiser_device(), Denoiser::load_kernels(), and PathTrace::tile_buffer_write_to_disk().
|
inlinevirtual |
Definition at line 215 of file device/device.h.
Referenced by find_best_device(), and PathTraceWorkGPU::should_use_graphics_interop().
|
static |
Definition at line 144 of file device/device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_HIP, DEVICE_METAL, DEVICE_MULTI, DEVICE_ONEAPI, DEVICE_OPTIX, and type.
Referenced by available_devices_func(), HdCyclesDelegate::GetRenderSetting(), and options_parse().
|
static |
Definition at line 411 of file device/device.cpp.
References free_memory().
|
static |
Definition at line 124 of file device/device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_HIP, DEVICE_METAL, DEVICE_MULTI, DEVICE_NONE, DEVICE_ONEAPI, and DEVICE_OPTIX.
Referenced by available_devices_func(), and options_parse().
|
friend |
Definition at line 267 of file device/device.h.
|
friend |
Definition at line 106 of file device/device.h.
|
friend |
Definition at line 266 of file device/device.h.
|
friend |
Definition at line 265 of file device/device.h.
|
protected |
Definition at line 114 of file device/device.h.
Referenced by dummy_device(), DummyDevice::DummyDevice(), error_message(), MultiDevice::error_message(), and set_error().
DeviceInfo Device::info |
Definition at line 129 of file device/device.h.
Referenced by available_devices(), MultiDevice::build_bvh(), CPUDevice::CPUDevice(), create(), PathTraceWork::create(), denoiser_device_report(), device_memory::device_is_cpu(), dummy_device(), DummyDevice::DummyDevice(), ShaderEval::eval(), ShaderEval::eval_cpu(), find_best_device(), CPUDevice::get_cpu_kernel_thread_globals(), get_multi_device(), is_single_supported_device(), Denoiser::load_kernels(), local_tbb_arena_create(), MultiDevice::MultiDevice(), PathTraceWorkCPU::PathTraceWorkCPU(), and Scene::Scene().
Profiler& Device::profiler |
Definition at line 150 of file device/device.h.
Referenced by create(), create_denoiser_device(), CPUDevice::get_cpu_kernel_thread_globals(), MultiDevice::MultiDevice(), PathTrace::PathTrace(), and PathTraceWorkCPU::render_samples().
Stats& Device::stats |
Definition at line 149 of file device/device.h.
Referenced by build_bvh(), CPUDevice::build_bvh(), create(), create_denoiser_device(), MultiDevice::find_suitable_mem_device(), CPUDevice::global_alloc(), CPUDevice::global_free(), CPUDevice::mem_alloc(), MultiDevice::mem_alloc(), MultiDevice::mem_copy_to(), CPUDevice::mem_free(), MultiDevice::mem_free(), MultiDevice::mem_zero(), PathTrace::PathTrace(), CPUDevice::tex_alloc(), and CPUDevice::tex_free().