Class GpuPipelineBuilder<TIn, TOut>
Typed GPU pipeline builder for strongly-typed kernel execution
public sealed class GpuPipelineBuilder<TIn, TOut> where TIn : notnull where TOut : notnull
Type Parameters
TInTOut
- Inheritance
-
GpuPipelineBuilder<TIn, TOut>
- Inherited Members
Constructors
GpuPipelineBuilder(IGrainFactory, KernelId)
Initializes a new instance of the GpuPipelineBuilder<TIn, TOut> class.
public GpuPipelineBuilder(IGrainFactory grainFactory, KernelId kernelId)
Parameters
grainFactoryIGrainFactoryThe Orleans grain factory.
kernelIdKernelIdThe kernel identifier.
Methods
ExecuteAsync(IReadOnlyList<TIn>, CancellationToken)
Executes the pipeline with the given input data using parallel batch processing
public Task<IReadOnlyList<TOut>> ExecuteAsync(IReadOnlyList<TIn> input, CancellationToken cancellationToken = default)
Parameters
inputIReadOnlyList<TIn>cancellationTokenCancellationToken
Returns
- Task<IReadOnlyList<TOut>>
Remarks
Uses SemaphoreSlim for concurrency control and implements retry logic with exponential backoff for failed batches (up to 3 attempts).
WithBatchSize(int)
Sets the batch size for processing
public GpuPipelineBuilder<TIn, TOut> WithBatchSize(int batchSize)
Parameters
batchSizeint
Returns
- GpuPipelineBuilder<TIn, TOut>
WithMaxConcurrency(int)
Sets the maximum concurrency for parallel batch execution
public GpuPipelineBuilder<TIn, TOut> WithMaxConcurrency(int maxConcurrency)
Parameters
maxConcurrencyintMaximum number of concurrent batch operations
Returns
- GpuPipelineBuilder<TIn, TOut>
The pipeline builder for fluent chaining
Remarks
Controls how many batches can be processed in parallel. Default is 1 (sequential processing). TODO: Implement parallel batch execution using SemaphoreSlim or similar