Table of Contents

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

GpuBackend

DeviceIndex

Gets the device index this context is bound to.

int DeviceIndex { get; }

Property Value

int

Methods

CompileKernel(string, string)

Compiles a kernel from source code.

IComputeKernel CompileKernel(string source, string entryPoint)

Parameters

source string

The kernel source code.

entryPoint string

The name of the entry point function.

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

size int

The number of elements in the buffer.

usage BufferUsage

The intended usage pattern for the buffer.

Returns

IComputeBuffer<T>

A new compute buffer instance.

Type Parameters

T

The unmanaged element type.

Execute(IComputeKernel, int)

Executes a compute kernel with the specified work size.

void Execute(IComputeKernel kernel, int workSize)

Parameters

kernel IComputeKernel

The kernel to execute.

workSize int

The number of work items to process.

Synchronize()

Synchronizes execution, waiting for all pending operations to complete.

void Synchronize()