UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
UN::IDeviceObject Class Referenceabstract

Base interface for all compute backend objects. More...

#include <IDeviceObject.h>

Inheritance diagram for UN::IDeviceObject:
UN::IObject UN::IBuffer UN::ICommandList UN::IDeviceMemory UN::IFence UN::IKernel UN::IResourceBinding UN::IVulkanDescriptorAllocator UN::Object< IBuffer > UN::Object< ICommandList > UN::Object< IDeviceMemory > UN::Object< IFence > UN::Object< IKernel > UN::Object< IResourceBinding > UN::Object< IVulkanDescriptorAllocator > UN::DeviceObjectBase< IBuffer > UN::DeviceObjectBase< ICommandList > UN::DeviceObjectBase< IDeviceMemory > UN::DeviceObjectBase< IFence > UN::DeviceObjectBase< IKernel > UN::DeviceObjectBase< IResourceBinding > UN::DeviceObjectBase< IVulkanDescriptorAllocator > UN::BufferBase UN::CommandListBase UN::DeviceMemoryBase UN::FenceBase UN::KernelBase UN::ResourceBindingBase UN::VulkanDescriptorAllocator UN::VulkanBuffer UN::VulkanCommandList UN::VulkanDeviceMemory UN::VulkanFence UN::VulkanKernel UN::VulkanResourceBinding

Public Member Functions

virtual std::string_view GetDebugName () const =0
 Get debug name of the object.
 
virtual void Reset ()=0
 Reset the object to uninitialized state. More...
 
virtual IComputeDeviceGetDevice () const =0
 Get the compute device this object was created on. More...
 
- Public Member Functions inherited from UN::IObject
virtual UInt32 AddRef ()=0
 Add a strong reference to object's reference counter. More...
 
virtual UInt32 Release ()=0
 Remove a strong reference from object's reference counter. More...
 
virtual void AttachRefCounter (ReferenceCounter *counter)=0
 Attach a ReferenceCounter to this object. More...
 
virtual ReferenceCounterGetRefCounter ()=0
 Get reference counter that belongs to this object. More...
 

Detailed Description

Base interface for all compute backend objects.

All objects related to a compute backend must implement deferred initialization. For example:

class IBuffer : public IDeviceObject
{
public:
using DescriptorType = BufferDesc;
virtual void Init(const DescriptorType& desc) = 0;
virtual const DescriptorType& GetDesc() = 0;
};
class Buffer : public DeviceObjectBase<IBuffer>
{
public:
static ResultCode Create(IBuffer** ppBuffer) { ... } // doesn't create any device objects
void Init(const BufferDesc& desc) override { ... } // creates device objects, allocates memory, etc.
void Reset() override { ... } // releases device objects and memory
};
Base class for all compute backend objects.
Definition: DeviceObjectBase.h:18
An interface for backend-specific buffers that store the data on the device.
Definition: IBuffer.h:26
Base interface for all compute backend objects.
Definition: IDeviceObject.h:30
virtual void Reset()=0
Reset the object to uninitialized state.
Buffer descriptor.
Definition: IBuffer.h:8

Member Function Documentation

◆ GetDevice()

virtual IComputeDevice * UN::IDeviceObject::GetDevice ( ) const
pure virtual

Get the compute device this object was created on.

Note
This function doesn't increment reference counter of the compute device.

◆ Reset()

virtual void UN::IDeviceObject::Reset ( )
pure virtual

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