Blender V4.3
GPUDevice Class Referenceabstract

#include <GPU_platform.hh>

Inherits Device.

Classes

struct  Mem

Public Member Functions

virtual ~GPUDevice () noexcept(false)
virtual bool load_texture_info ()
Public Member Functions inherited from Device
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< DeviceQueuegpu_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)

Public Attributes

std::string identifier
int index
uint32_t vendor_id
uint32_t device_id
std::string name
device_vector< TextureInfotexture_info
bool need_texture_info
Public Attributes inherited from Device
DeviceInfo info
Statsstats
Profilerprofiler
bool headless = true

Protected Types

typedef unsigned long long texMemObject
typedef unsigned long long arrayMemObject
typedef map< device_memory *, MemMemMap

Protected Member Functions

 GPUDevice (const DeviceInfo &info_, Stats &stats_, Profiler &profiler_, bool headless_)
virtual void init_host_memory (size_t preferred_texture_headroom=0, size_t preferred_working_headroom=0)
virtual void move_textures_to_host (size_t size, bool for_texture)
virtual GPUDevice::Memgeneric_alloc (device_memory &mem, size_t pitch_padding=0)
virtual void generic_free (device_memory &mem)
virtual void generic_copy_to (device_memory &mem)
virtual void get_device_memory_info (size_t &total, size_t &free)=0
virtual bool alloc_device (void *&device_pointer, size_t size)=0
virtual void free_device (void *device_pointer)=0
virtual bool alloc_host (void *&shared_pointer, size_t size)=0
virtual void free_host (void *shared_pointer)=0
virtual void transform_host_pointer (void *&device_pointer, void *&shared_pointer)=0
virtual void copy_host_to_device (void *device_pointer, void *host_pointer, size_t size)=0
Protected Member Functions inherited from Device
 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

bool can_map_host
size_t map_host_used
size_t map_host_limit
size_t device_texture_headroom
size_t device_working_headroom
MemMap device_mem_map
thread_mutex device_mem_map_mutex
bool move_texture_to_host
size_t device_mem_in_use
Protected Attributes inherited from Device
string error_msg

Friends

class device_memory

Additional Inherited Members

Static Public Member Functions inherited from Device
static const CPUKernelsget_cpu_kernels ()
static Devicecreate (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< DeviceTypeavailable_types ()
static vector< DeviceInfoavailable_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 ()

Detailed Description

Definition at line 69 of file GPU_platform.hh.

Member Typedef Documentation

◆ arrayMemObject

typedef unsigned long long GPUDevice::arrayMemObject
protected

Definition at line 370 of file device/device.h.

◆ MemMap

typedef map<device_memory *, Mem> GPUDevice::MemMap
protected

Definition at line 380 of file device/device.h.

◆ texMemObject

typedef unsigned long long GPUDevice::texMemObject
protected

Definition at line 369 of file device/device.h.

Constructor & Destructor Documentation

◆ GPUDevice()

GPUDevice::GPUDevice ( const DeviceInfo & info_,
Stats & stats_,
Profiler & profiler_,
bool headless_ )
inlineprotected

◆ ~GPUDevice()

GPUDevice::~GPUDevice ( )
virtual

Definition at line 492 of file device/device.cpp.

References false.

Member Function Documentation

◆ alloc_device()

virtual bool GPUDevice::alloc_device ( void *& device_pointer,
size_t size )
protectedpure virtual

References size().

Referenced by generic_alloc().

◆ alloc_host()

virtual bool GPUDevice::alloc_host ( void *& shared_pointer,
size_t size )
protectedpure virtual

References size().

Referenced by generic_alloc().

◆ copy_host_to_device()

virtual void GPUDevice::copy_host_to_device ( void * device_pointer,
void * host_pointer,
size_t size )
protectedpure virtual

References size().

Referenced by generic_copy_to().

◆ free_device()

virtual void GPUDevice::free_device ( void * device_pointer)
protectedpure virtual

Referenced by generic_free().

◆ free_host()

virtual void GPUDevice::free_host ( void * shared_pointer)
protectedpure virtual

Referenced by generic_free().

◆ generic_alloc()

◆ generic_copy_to()

◆ generic_free()

◆ get_device_memory_info()

virtual void GPUDevice::get_device_memory_info ( size_t & total,
size_t & free )
protectedpure virtual

References free().

Referenced by generic_alloc().

◆ init_host_memory()

void GPUDevice::init_host_memory ( size_t preferred_texture_headroom = 0,
size_t preferred_working_headroom = 0 )
protectedvirtual

◆ load_texture_info()

bool GPUDevice::load_texture_info ( )
virtual

Definition at line 494 of file device/device.cpp.

References need_texture_info, and texture_info.

Referenced by move_textures_to_host().

◆ move_textures_to_host()

◆ transform_host_pointer()

virtual void GPUDevice::transform_host_pointer ( void *& device_pointer,
void *& shared_pointer )
protectedpure virtual

Referenced by generic_alloc().

◆ device_memory

friend class device_memory
friend

Member Data Documentation

◆ can_map_host

bool GPUDevice::can_map_host
protected

Definition at line 364 of file device/device.h.

Referenced by generic_alloc(), and GPUDevice().

◆ device_id

uint32_t GPUDevice::device_id

Definition at line 73 of file GPU_platform.hh.

◆ device_mem_in_use

size_t GPUDevice::device_mem_in_use
protected

Definition at line 385 of file device/device.h.

Referenced by generic_alloc(), generic_free(), and GPUDevice().

◆ device_mem_map

MemMap GPUDevice::device_mem_map
protected

◆ device_mem_map_mutex

thread_mutex GPUDevice::device_mem_map_mutex
protected

◆ device_texture_headroom

size_t GPUDevice::device_texture_headroom
protected

Definition at line 367 of file device/device.h.

Referenced by generic_alloc(), GPUDevice(), and init_host_memory().

◆ device_working_headroom

size_t GPUDevice::device_working_headroom
protected

Definition at line 368 of file device/device.h.

Referenced by generic_alloc(), GPUDevice(), and init_host_memory().

◆ identifier

std::string GPUDevice::identifier

Definition at line 70 of file GPU_platform.hh.

◆ index

int GPUDevice::index

Definition at line 71 of file GPU_platform.hh.

◆ map_host_limit

size_t GPUDevice::map_host_limit
protected

Definition at line 366 of file device/device.h.

Referenced by generic_alloc(), GPUDevice(), and init_host_memory().

◆ map_host_used

size_t GPUDevice::map_host_used
protected

Definition at line 365 of file device/device.h.

Referenced by generic_alloc(), generic_free(), and GPUDevice().

◆ move_texture_to_host

bool GPUDevice::move_texture_to_host
protected

Definition at line 383 of file device/device.h.

Referenced by generic_alloc(), GPUDevice(), and move_textures_to_host().

◆ name

std::string GPUDevice::name

Definition at line 74 of file GPU_platform.hh.

◆ need_texture_info

bool GPUDevice::need_texture_info

Definition at line 355 of file device/device.h.

Referenced by GPUDevice(), and load_texture_info().

◆ texture_info

device_vector<TextureInfo> GPUDevice::texture_info

◆ vendor_id

uint32_t GPUDevice::vendor_id

Definition at line 72 of file GPU_platform.hh.


The documentation for this class was generated from the following files: