|
Blender V4.3
|
#include <device.h>
Inherited by CPUDevice, DummyDevice, GPUDevice, and MultiDevice.
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 (uint kernel_features) const =0 |
| virtual void | const_copy_to (const char *name, void *host, size_t size)=0 |
| virtual bool | load_kernels (uint) |
| virtual bool | load_osl_kernels () |
| virtual void | cancel () |
| virtual bool | is_ready (string &) const |
| 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_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 void * | get_native_buffer (device_ptr) |
| virtual void * | get_guiding_device () const |
| 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, bool headless) |
| 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 |
| bool | headless = true |
Protected Member Functions | |
| Device (const DeviceInfo &info_, Stats &stats_, Profiler &profiler_, bool headless_) | |
| 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 136 of file device/device.h.
|
inlineprotected |
Definition at line 140 of file device/device.h.
|
virtual |
Definition at line 50 of file device/device.cpp.
|
static |
Definition at line 211 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(), info, and lock.
Referenced by available_devices_func(), blender_device_info(), and options_parse().
|
static |
Definition at line 185 of file device/device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_HIP, DEVICE_HIPRT, DEVICE_METAL, DEVICE_ONEAPI, DEVICE_OPTIX, and types.
Referenced by get_device_types_func(), and options_parse().
Reimplemented in CPUDevice, and MultiDevice.
Definition at line 52 of file device/device.cpp.
References BVH2::build(), BVHParams::bvh_layout, BVH_LAYOUT_BVH2, BVH::params, BVH2::refit(), refit(), and stats.
Referenced by CPUDevice::build_bvh(), MultiDevice::build_bvh(), Geometry::compute_bvh(), and GeometryManager::device_update_bvh().
|
inlinevirtual |
Definition at line 199 of file device/device.h.
Referenced by Session::cancel().
|
inlinevirtual |
Definition at line 244 of file device/device.h.
Referenced by MultiDevice::MultiDevice().
|
pure virtual |
Implemented in CPUDevice, DummyDevice, and MultiDevice.
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(), headless, info, DeviceInfo::multi_devices, NULL, profiler, stats, and DeviceInfo::type.
Referenced by DenoiserPipeline::DenoiserPipeline(), MultiDevice::MultiDevice(), Session::Session(), and RenderGraph::SetUp().
|
static |
Definition at line 312 of file device/device.cpp.
References device_capabilities(), 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(), and lock.
Referenced by device_capabilities(), and system_info_func().
Reimplemented in MultiDevice.
Definition at line 230 of file device/device.h.
|
static |
Definition at line 304 of file device/device.cpp.
References DEVICE_DUMMY, error_msg, DeviceInfo::error_msg, info, and DeviceInfo::type.
Referenced by blender_device_info().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 161 of file device/device.h.
References error_msg.
Referenced by MultiDevice::error_message(), have_error(), Denoiser::load_kernels(), Scene::load_kernels(), Session::run_main_render_loop(), and Session::Session().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 283 of file device/device.h.
References callback.
Referenced by ShaderEval::eval(), find_best_device(), MultiDevice::foreach_device(), and PathTrace::PathTrace().
|
static |
Definition at line 457 of file device/device.cpp.
References vector< value_type, allocator_type >::free_memory().
Referenced by exit_func(), and tag_update().
|
pure virtual |
Implemented in CPUDevice, DummyDevice, and MultiDevice.
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 481 of file device/device.cpp.
References LOG.
Referenced by ShaderEval::eval_cpu(), and PathTraceWorkCPU::init_execution().
|
static |
Definition at line 474 of file device/device.cpp.
Referenced by CPUDevice::CPUDevice(), and ShaderEval::eval_cpu().
|
virtual |
Reimplemented in CPUDevice, and MultiDevice.
Definition at line 487 of file device/device.cpp.
Referenced by GeometryManager::device_free(), and GeometryManager::update_osl_globals().
|
inlinevirtual |
Reimplemented in CPUDevice.
Definition at line 272 of file device/device.h.
References LOG.
Referenced by PathTrace::set_guiding_params().
|
static |
Definition at line 373 of file device/device.cpp.
References DeviceInfo::cpu_threads, DENOISER_ALL, DeviceInfo::denoisers, DeviceInfo::description, DEVICE_CPU, DEVICE_MULTI, DEVICE_NONE, DeviceInfo::has_guiding, DeviceInfo::has_mnee, 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, DeviceInfo::type, DeviceInfo::use_hardware_raytracing, and VLOG_INFO.
Referenced by blender_device_info().
|
inlinevirtual |
Definition at line 264 of file device/device.h.
|
virtual |
Definition at line 468 of file device/device.cpp.
References LOG.
Referenced by DenoiserGPU::DenoiserGPU(), and ShaderEval::eval_gpu().
|
inline |
Definition at line 165 of file device/device.h.
References error_message().
Referenced by PathTraceWorkGPU::copy_to_display(), Scene::device_update(), PathTrace::path_trace(), Session::run_main_render_loop(), Session::Session(), and set_error().
|
inlinevirtual |
Definition at line 202 of file device/device.h.
Referenced by Session::run_update_for_next_iteration(), and Session::update_status_time().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 238 of file device/device.h.
Referenced by device_memory::is_resident().
|
inlinevirtual |
Reimplemented in CPUDevice, and MultiDevice.
Definition at line 188 of file device/device.h.
Referenced by DenoiserPipeline::DenoiserPipeline(), Denoiser::load_kernels(), MultiDevice::load_kernels(), and Scene::load_kernels().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 193 of file device/device.h.
Referenced by MultiDevice::load_osl_kernels().
|
protectedpure virtual |
Implemented in CPUDevice, DummyDevice, and MultiDevice.
Referenced by device_memory::device_alloc(), and MultiDevice::mem_alloc().
|
inlineprotectedvirtual |
Reimplemented in CPUDevice.
Definition at line 147 of file device/device.h.
Referenced by device_sub_ptr::device_sub_ptr().
|
protectedpure virtual |
Implemented in CPUDevice, DummyDevice, and MultiDevice.
Referenced by device_memory::device_copy_from(), and MultiDevice::mem_copy_from().
|
protectedpure virtual |
Implemented in CPUDevice, DummyDevice, and MultiDevice.
Referenced by device_memory::device_copy_to(), and MultiDevice::mem_copy_to().
|
protectedpure virtual |
Implemented in CPUDevice, DummyDevice, and MultiDevice.
Referenced by device_memory::device_free(), and MultiDevice::mem_free().
|
inlineprotectedvirtual |
Definition at line 153 of file device/device.h.
Referenced by device_sub_ptr::~device_sub_ptr().
|
protectedpure virtual |
Implemented in CPUDevice, DummyDevice, and MultiDevice.
Referenced by device_memory::device_zero(), and MultiDevice::mem_zero().
|
inlinevirtual |
Definition at line 236 of file device/device.h.
Referenced by Scene::device_update().
|
inlinevirtual |
Definition at line 227 of file device/device.h.
|
inlinevirtual |
Definition at line 169 of file device/device.h.
References error(), error_msg, and have_error().
Referenced by GPUDevice::generic_alloc(), Denoiser::set_error(), and PathTrace::tile_buffer_write_to_disk().
|
inlinevirtual |
Definition at line 258 of file device/device.h.
Referenced by find_best_device(), and PathTraceWorkGPU::should_use_graphics_interop().
|
static |
Definition at line 155 of file device/device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_HIP, DEVICE_HIPRT, DEVICE_METAL, DEVICE_MULTI, DEVICE_ONEAPI, and DEVICE_OPTIX.
Referenced by available_devices_func(), HdCyclesDelegate::GetRenderSetting(), and options_parse().
|
static |
Definition at line 452 of file device/device.cpp.
References free_memory().
|
static |
Definition at line 125 of file device/device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_HIP, DEVICE_HIPRT, DEVICE_METAL, DEVICE_MULTI, DEVICE_NONE, DEVICE_ONEAPI, and DEVICE_OPTIX.
Referenced by available_devices_func(), and options_parse().
|
friend |
Definition at line 310 of file device/device.h.
|
friend |
Definition at line 137 of file device/device.h.
|
friend |
Definition at line 309 of file device/device.h.
|
friend |
Definition at line 308 of file device/device.h.
|
protected |
Definition at line 145 of file device/device.h.
Referenced by dummy_device(), DummyDevice::DummyDevice(), error_message(), MultiDevice::error_message(), and set_error().
| bool Device::headless = true |
Definition at line 182 of file device/device.h.
Referenced by create(), MultiDevice::MultiDevice(), and PathTrace::PathTrace().
| DeviceInfo Device::info |
Definition at line 160 of file device/device.h.
Referenced by available_devices(), MultiDevice::build_bvh(), CPUDevice::CPUDevice(), Denoiser::create(), 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_effective_denoise_params(), Integrator::get_guiding_params(), get_multi_device(), is_single_device(), Denoiser::load_kernels(), local_tbb_arena_create(), MultiDevice::MultiDevice(), PathTraceWorkCPU::PathTraceWorkCPU(), Scene::Scene(), PathTrace::set_denoiser_params(), Scene::update_kernel_features(), use_gpu_oidn_denoiser(), and use_optix_denoiser().
| Profiler& Device::profiler |
Definition at line 181 of file device/device.h.
Referenced by create(), DenoiserPipeline::DenoiserPipeline(), CPUDevice::get_cpu_kernel_thread_globals(), MultiDevice::MultiDevice(), PathTrace::PathTrace(), and PathTraceWorkCPU::render_samples().
| Stats& Device::stats |
Definition at line 180 of file device/device.h.
Referenced by CPUDevice::build_bvh(), build_bvh(), create(), DenoiserPipeline::DenoiserPipeline(), MultiDevice::find_suitable_mem_device(), GPUDevice::generic_alloc(), GPUDevice::generic_free(), 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().