Class ProductionKernelExecutor
- Namespace
- DotCompute.Runtime.Services
- Assembly
- DotCompute.Runtime.dll
Production kernel execution service with advanced scheduling, monitoring, and optimization.
public sealed class ProductionKernelExecutor : IDisposable
- Inheritance
-
ProductionKernelExecutor
- Implements
- Inherited Members
- Extension Methods
Constructors
ProductionKernelExecutor(ILogger<ProductionKernelExecutor>, IAccelerator, int)
Initializes a new instance of the ProductionKernelExecutor class.
public ProductionKernelExecutor(ILogger<ProductionKernelExecutor> logger, IAccelerator accelerator, int maxConcurrentExecutions = 16)
Parameters
loggerILogger<ProductionKernelExecutor>The logger.
acceleratorIAcceleratorThe accelerator.
maxConcurrentExecutionsintThe max concurrent executions.
Properties
Statistics
Gets or sets the statistics.
public KernelExecutionStatistics Statistics { get; }
Property Value
- KernelExecutionStatistics
The statistics.
Methods
CancelExecution(Guid)
Cancels a specific kernel execution.
public bool CancelExecution(Guid executionId)
Parameters
executionIdGuid
Returns
Dispose()
Performs dispose.
public void Dispose()
ExecuteBatchAsync(IEnumerable<(ICompiledKernel Kernel, IKernelExecutionParameters Parameters)>, BatchExecutionOptions?, CancellationToken)
Executes a batch of kernels with optimized scheduling.
public Task<IReadOnlyList<KernelExecutionResult>> ExecuteBatchAsync(IEnumerable<(ICompiledKernel Kernel, IKernelExecutionParameters Parameters)> kernelBatch, BatchExecutionOptions? options = null, CancellationToken cancellationToken = default)
Parameters
kernelBatchIEnumerable<(ICompiledKernel Kernel, IKernelExecutionParameters Parameters)>optionsBatchExecutionOptionscancellationTokenCancellationToken
Returns
ExecuteKernelAsync(ICompiledKernel, IKernelExecutionParameters, CancellationToken)
Executes a kernel asynchronously with comprehensive monitoring and error handling.
public Task<KernelExecutionResult> ExecuteKernelAsync(ICompiledKernel kernel, IKernelExecutionParameters parameters, CancellationToken cancellationToken = default)
Parameters
kernelICompiledKernelparametersIKernelExecutionParameterscancellationTokenCancellationToken
Returns
GetExecutionStatus()
Gets the current status of all executing kernels.
public IReadOnlyDictionary<Guid, KernelExecutionStatus> GetExecutionStatus()