UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
IComputeDevice.h
1#pragma once
2#include <UnCompute/Backend/BaseTypes.h>
3#include <UnCompute/Backend/IDeviceObject.h>
4
5namespace UN
6{
9 {
10 UInt32 AdapterId;
11
12 inline ComputeDeviceDesc()
13 : AdapterId(0)
14 {
15 }
16
17 inline explicit ComputeDeviceDesc(UInt32 adapterId)
18 : AdapterId(adapterId)
19 {
20 }
21 };
22
23 class IFence;
24 class IBuffer;
25 class IDeviceMemory;
26 class ICommandList;
27 class IResourceBinding;
28 class IKernel;
29
37 class IComputeDevice : public IObject
38 {
39 public:
40 ~IComputeDevice() override = default;
41
45 virtual ResultCode Init(const ComputeDeviceDesc& desc) = 0;
46
48 virtual void Reset() = 0;
49
50 virtual ResultCode CreateBuffer(IBuffer** ppBuffer) = 0;
51
52 virtual ResultCode CreateMemory(IDeviceMemory** ppMemory) = 0;
53
54 virtual ResultCode CreateFence(IFence** ppFence) = 0;
55
56 virtual ResultCode CreateCommandList(ICommandList** ppCommandList) = 0;
57
58 virtual ResultCode CreateResourceBinding(IResourceBinding** ppResourceBinding) = 0;
59
60 virtual ResultCode CreateKernel(IKernel** ppKernel) = 0;
61 };
62} // namespace UN
An interface for backend-specific buffers that store the data on the device.
Definition: IBuffer.h:26
An interface for command lists that record commands to be executed by the backend.
Definition: ICommandList.h:180
Interface for all backend-specific compute devices.
Definition: IComputeDevice.h:38
virtual ResultCode Init(const ComputeDeviceDesc &desc)=0
Initializes the compute device with the provided descriptor.
virtual void Reset()=0
Reset the object to uninitialized state.
This class holds a handle to backend-specific memory.
Definition: IDeviceMemory.h:31
An interface for fences - synchronization primitives that can be either signaled or reset.
Definition: IFence.h:31
An interface for compute kernel - a program running on the device.
Definition: IKernel.h:29
Base interface for dynamic reference counted objects.
Definition: Object.h:8
Resource binding object used to bind resources to a compute kernel.
Definition: IResourceBinding.h:51
Compute device descriptor.
Definition: IComputeDevice.h:9
UInt32 AdapterId
ID of the adapter to create the device on.
Definition: IComputeDevice.h:10