Table of Contents

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

logger ILogger<ProductionKernelExecutor>

The logger.

accelerator IAccelerator

The accelerator.

maxConcurrentExecutions int

The 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

executionId Guid

Returns

bool

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

kernelBatch IEnumerable<(ICompiledKernel Kernel, IKernelExecutionParameters Parameters)>
options BatchExecutionOptions
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<KernelExecutionResult>>

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

kernel ICompiledKernel
parameters IKernelExecutionParameters
cancellationToken CancellationToken

Returns

Task<KernelExecutionResult>

GetExecutionStatus()

Gets the current status of all executing kernels.

public IReadOnlyDictionary<Guid, KernelExecutionStatus> GetExecutionStatus()

Returns

IReadOnlyDictionary<Guid, KernelExecutionStatus>