Interface IComputeContext
- Namespace
- Orleans.GpuBridge.Runtime.BackendProviders.Interfaces
- Assembly
- Orleans.GpuBridge.Runtime.dll
Compute context interface for GPU operations.
public interface IComputeContext : IDisposable
- Inherited Members
Properties
Backend
Gets the GPU backend type for this context.
GpuBackend Backend { get; }
Property Value
DeviceIndex
Gets the device index this context is bound to.
int DeviceIndex { get; }
Property Value
Methods
CompileKernel(string, string)
Compiles a kernel from source code.
IComputeKernel CompileKernel(string source, string entryPoint)
Parameters
Returns
- IComputeKernel
A compiled compute kernel.
CreateBuffer<T>(int, BufferUsage)
Creates a compute buffer for the specified element type.
IComputeBuffer<T> CreateBuffer<T>(int size, BufferUsage usage) where T : unmanaged
Parameters
sizeintThe number of elements in the buffer.
usageBufferUsageThe intended usage pattern for the buffer.
Returns
- IComputeBuffer<T>
A new compute buffer instance.
Type Parameters
TThe unmanaged element type.
Execute(IComputeKernel, int)
Executes a compute kernel with the specified work size.
void Execute(IComputeKernel kernel, int workSize)
Parameters
kernelIComputeKernelThe kernel to execute.
workSizeintThe number of work items to process.
Synchronize()
Synchronizes execution, waiting for all pending operations to complete.
void Synchronize()