2#include <UnCompute/Backend/IComputeDevice.h>
3#include <UnCompute/Backend/IDeviceObject.h>
4#include <UnCompute/Memory/Ptr.h>
16 template<
class TInterface, std::enable_if_t<std::is_base_of_v<IDeviceObject, TInterface>,
bool> = true>
20 using DescriptorType =
typename TInterface::DescriptorType;
24 DescriptorType m_Desc;
31 inline void Init(std::string_view name,
const DescriptorType& desc)
43 inline const DescriptorType& GetDesc()
const override
48 [[nodiscard]]
inline std::string_view GetDebugName()
const override
53 [[nodiscard]]
inline IComputeDevice* GetDevice()
const override
55 return m_pDevice.
Get();
58 [[nodiscard]]
inline UInt32 Release()
override
60 Ptr<IComputeDevice> pDevice;
Base class for all compute backend objects.
Definition: DeviceObjectBase.h:18
void Init(std::string_view name, const DescriptorType &desc)
Common device object initializer.
Definition: DeviceObjectBase.h:31
Interface for all backend-specific compute devices.
Definition: IComputeDevice.h:38
Base class for dynamic reference counted objects.
Definition: Object.h:51
UInt32 Release() override
Definition: Object.h:82
Shared smart pointer implementation that uses reference counting.
Definition: Ptr.h:44
T * Get() const
Get underlying raw pointer.
Definition: Ptr.h:219