Interface IKernelPipelineBuilder
- Namespace
- DotCompute.Abstractions.Pipelines
- Assembly
- DotCompute.Abstractions.dll
Simple builder interface for creating compute kernel pipelines
public interface IKernelPipelineBuilder
Methods
AddStage(string, params object[])
Adds a kernel stage to the pipeline
IKernelPipelineBuilder AddStage(string kernelName, params object[] parameters)
Parameters
Returns
- IKernelPipelineBuilder
The pipeline builder for method chaining
Create()
Creates a pipeline instance from the current builder configuration
object Create()
Returns
- object
A pipeline instance that can be executed
ExecuteAsync<T>(T, CancellationToken)
Executes the pipeline with the given input data
Task<T> ExecuteAsync<T>(T input, CancellationToken cancellationToken = default)
Parameters
inputTInput data
cancellationTokenCancellationTokenCancellation token
Returns
- Task<T>
Pipeline execution result
Type Parameters
TInput/output data type
ExecutePipelineAsync<T>(CancellationToken)
Executes the pipeline and returns the specified output type
Task<T> ExecutePipelineAsync<T>(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token
Returns
- Task<T>
Pipeline execution result
Type Parameters
TOutput data type
FromData<T>(T[])
Creates a new pipeline starting with input data array (compatibility method)
IKernelPipelineBuilder FromData<T>(T[] inputData) where T : unmanaged
Parameters
inputDataT[]The input data array to process
Returns
- IKernelPipelineBuilder
A new pipeline initialized with the input data
Type Parameters
TThe element type of the input data
FromStream<T>(IAsyncEnumerable<T>)
Creates a pipeline starting with an async data stream (compatibility method)
IKernelPipelineBuilder FromStream<T>(IAsyncEnumerable<T> inputStream) where T : unmanaged
Parameters
inputStreamIAsyncEnumerable<T>The async enumerable input stream
Returns
- IKernelPipelineBuilder
A new streaming pipeline
Type Parameters
TThe element type of the input stream
Transform<TInput, TOutput>(Func<TInput, TOutput>)
Adds a transformation stage to the pipeline
IKernelPipelineBuilder Transform<TInput, TOutput>(Func<TInput, TOutput> transform)
Parameters
transformFunc<TInput, TOutput>Transformation function
Returns
- IKernelPipelineBuilder
The pipeline builder for method chaining
Type Parameters
TInputInput data type
TOutputOutput data type