Table of Contents

Class CudaComputeContext

Namespace
Orleans.GpuBridge.Runtime
Assembly
Orleans.GpuBridge.Runtime.dll

Production CUDA compute context implementation

public sealed class CudaComputeContext : IComputeContext, IDisposable
Inheritance
CudaComputeContext
Implements
Inherited Members

Constructors

CudaComputeContext(ILogger)

Initializes a new instance of the CudaComputeContext class

public CudaComputeContext(ILogger logger)

Parameters

logger ILogger

Logger instance for diagnostics

Properties

Backend

Gets the compute backend type (CUDA)

public GpuBackend Backend { get; }

Property Value

GpuBackend

DeviceIndex

Gets the CUDA device index

public int DeviceIndex { get; }

Property Value

int

Methods

CompileKernel(string, string)

Compiles a CUDA compute kernel

public IComputeKernel CompileKernel(string source, string entryPoint)

Parameters

source string

Kernel source code

entryPoint string

Entry point function name

Returns

IComputeKernel

A compiled CUDA kernel instance

CreateBuffer<T>(int, BufferUsage)

Creates a new CUDA compute buffer

public IComputeBuffer<T> CreateBuffer<T>(int size, BufferUsage usage) where T : unmanaged

Parameters

size int

Number of elements in the buffer

usage BufferUsage

Usage flags for the buffer

Returns

IComputeBuffer<T>

A new CUDA compute buffer instance

Type Parameters

T

The unmanaged element type

Dispose()

Disposes the CUDA compute context

public void Dispose()

Execute(IComputeKernel, int)

Executes a CUDA compute kernel

public void Execute(IComputeKernel kernel, int workSize)

Parameters

kernel IComputeKernel

The kernel to execute

workSize int

Number of work items to execute

Synchronize()

Synchronizes the CUDA context

public void Synchronize()