Table of Contents

Class GpuPipeline

Namespace
Orleans.GpuBridge.BridgeFX
Assembly
Orleans.GpuBridge.BridgeFX.dll

Fluent pipeline builder for GPU processing

public sealed class GpuPipeline
Inheritance
GpuPipeline
Inherited Members

Constructors

GpuPipeline(IGpuBridge, ILogger<GpuPipeline>)

Initializes a new instance of the GpuPipeline class.

public GpuPipeline(IGpuBridge bridge, ILogger<GpuPipeline> logger)

Parameters

bridge IGpuBridge

The GPU bridge instance.

logger ILogger<GpuPipeline>

The logger instance.

Methods

AddKernel<TIn, TOut>(KernelId, Func<TIn, bool>?)

Adds a kernel stage to the pipeline

public GpuPipeline AddKernel<TIn, TOut>(KernelId kernelId, Func<TIn, bool>? filter = null) where TIn : notnull where TOut : notnull

Parameters

kernelId KernelId
filter Func<TIn, bool>

Returns

GpuPipeline

Type Parameters

TIn
TOut

Batch<T>(int, TimeSpan?)

Adds a batch stage to the pipeline

public GpuPipeline Batch<T>(int batchSize, TimeSpan? timeout = null) where T : notnull

Parameters

batchSize int
timeout TimeSpan?

Returns

GpuPipeline

Type Parameters

T

Build<TInput, TOutput>()

Builds and returns an executable pipeline

public IPipeline<TInput, TOutput> Build<TInput, TOutput>() where TInput : notnull where TOutput : notnull

Returns

IPipeline<TInput, TOutput>

Type Parameters

TInput
TOutput

Filter<T>(Func<T, bool>)

Adds a filter stage to the pipeline

public GpuPipeline Filter<T>(Func<T, bool> predicate) where T : notnull

Parameters

predicate Func<T, bool>

Returns

GpuPipeline

Type Parameters

T

For<TIn, TOut>(IGrainFactory, string)

Creates a typed GPU pipeline for a specific kernel

public static GpuPipelineBuilder<TIn, TOut> For<TIn, TOut>(IGrainFactory grainFactory, string kernelId) where TIn : notnull where TOut : notnull

Parameters

grainFactory IGrainFactory
kernelId string

Returns

GpuPipelineBuilder<TIn, TOut>

Type Parameters

TIn
TOut

Parallel<TIn, TOut>(Func<TIn, Task<TOut>>, int)

Adds a parallel stage to the pipeline

public GpuPipeline Parallel<TIn, TOut>(Func<TIn, Task<TOut>> processor, int maxConcurrency = 0) where TIn : notnull where TOut : notnull

Parameters

processor Func<TIn, Task<TOut>>
maxConcurrency int

Returns

GpuPipeline

Type Parameters

TIn
TOut

Tap<T>(Action<T>)

Adds a tap stage for side effects

public GpuPipeline Tap<T>(Action<T> action) where T : notnull

Parameters

action Action<T>

Returns

GpuPipeline

Type Parameters

T

Transform<TIn, TOut>(Func<TIn, Task<TOut>>)

Adds an async transform stage to the pipeline

public GpuPipeline Transform<TIn, TOut>(Func<TIn, Task<TOut>> asyncTransform) where TIn : notnull where TOut : notnull

Parameters

asyncTransform Func<TIn, Task<TOut>>

Returns

GpuPipeline

Type Parameters

TIn
TOut

Transform<TIn, TOut>(Func<TIn, TOut>)

Adds a transform stage to the pipeline

public GpuPipeline Transform<TIn, TOut>(Func<TIn, TOut> transform) where TIn : notnull where TOut : notnull

Parameters

transform Func<TIn, TOut>

Returns

GpuPipeline

Type Parameters

TIn
TOut