Table of Contents

Class GpuBridge

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

Main implementation of the GPU bridge

public sealed class GpuBridge : IGpuBridge
Inheritance
GpuBridge
Implements
Inherited Members

Constructors

GpuBridge(ILogger<GpuBridge>, KernelCatalog, DeviceBroker, IOptions<GpuBridgeOptions>, IServiceProvider)

Initializes a new instance of the GpuBridge class

public GpuBridge(ILogger<GpuBridge> logger, KernelCatalog kernelCatalog, DeviceBroker deviceBroker, IOptions<GpuBridgeOptions> options, IServiceProvider serviceProvider)

Parameters

logger ILogger<GpuBridge>

Logger instance

kernelCatalog KernelCatalog

Kernel catalog for kernel management

deviceBroker DeviceBroker

Device broker for GPU management

options IOptions<GpuBridgeOptions>

GPU bridge configuration options

serviceProvider IServiceProvider

Service provider for dependency injection

Methods

ExecuteKernelAsync(string, object, CancellationToken)

Executes a kernel with dynamic type resolution (non-generic overload)

[RequiresDynamicCode("Dynamic kernel execution uses runtime reflection to create generic method calls.")]
[RequiresUnreferencedCode("Dynamic kernel execution uses reflection which may not work with trimming.")]
public ValueTask<object> ExecuteKernelAsync(string kernelId, object input, CancellationToken ct = default)

Parameters

kernelId string

Kernel identifier

input object

Input data (type will be inferred)

ct CancellationToken

Cancellation token

Returns

ValueTask<object>

Kernel execution result

ExecuteKernelAsync<TRequest, TResponse>(string, TRequest, CancellationToken)

Executes a kernel dynamically with specified input and output types.

public ValueTask<TResponse> ExecuteKernelAsync<TRequest, TResponse>(string kernelId, TRequest input, CancellationToken ct = default) where TRequest : notnull where TResponse : notnull

Parameters

kernelId string

The kernel identifier.

input TRequest

The input object.

ct CancellationToken

Cancellation token.

Returns

ValueTask<TResponse>

The execution result.

Type Parameters

TRequest

The request type.

TResponse

The response type.

GetDevicesAsync(CancellationToken)

Gets the list of available GPU devices

public ValueTask<IReadOnlyList<GpuDevice>> GetDevicesAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

ValueTask<IReadOnlyList<GpuDevice>>

GetInfoAsync(CancellationToken)

Gets information about the GPU bridge and available resources

public ValueTask<GpuBridgeInfo> GetInfoAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

ValueTask<GpuBridgeInfo>

GetKernelAsync<TIn, TOut>(KernelId, CancellationToken)

Gets a kernel executor for the specified kernel ID

public ValueTask<IGpuKernel<TIn, TOut>> GetKernelAsync<TIn, TOut>(KernelId kernelId, CancellationToken ct = default) where TIn : notnull where TOut : notnull

Parameters

kernelId KernelId
ct CancellationToken

Returns

ValueTask<IGpuKernel<TIn, TOut>>

Type Parameters

TIn
TOut