Class CpuCompiledKernel
- Namespace
- DotCompute.Backends.CPU.Accelerators
- Assembly
- DotCompute.Backends.CPU.dll
Represents a compiled kernel for CPU execution with vectorization support. Orchestrates execution through specialized components for optimal performance.
public sealed class CpuCompiledKernel : ICompiledKernel, IAsyncDisposable, IDisposable
- Inheritance
-
CpuCompiledKernel
- Implements
- Inherited Members
- Extension Methods
Constructors
CpuCompiledKernel(KernelDefinition, KernelExecutionPlan, CpuThreadPool, ILogger)
Initializes a new instance of the CpuCompiledKernel class.
public CpuCompiledKernel(KernelDefinition definition, KernelExecutionPlan executionPlan, CpuThreadPool threadPool, ILogger logger)
Parameters
definitionKernelDefinitionThe definition.
executionPlanKernelExecutionPlanThe execution plan.
threadPoolCpuThreadPoolThe thread pool.
loggerILoggerThe logger.
Properties
Definition
Gets or sets the definition.
public KernelDefinition Definition { get; }
Property Value
- KernelDefinition
The definition.
EntryPoint
Gets or sets the entry point.
public string EntryPoint { get; }
Property Value
- string
The entry point.
Id
Gets or sets the id.
public Guid Id { get; }
Property Value
- Guid
The id.
IsValid
Gets or sets a value indicating whether valid.
public bool IsValid { get; }
Property Value
- bool
The is valid.
Name
Gets or sets the name.
public string Name { get; }
Property Value
- string
The name.
Source
Gets or sets the source.
public string Source { get; }
Property Value
- string
The source.
Methods
Dispose()
Performs dispose.
public void Dispose()
DisposeAsync()
Gets dispose asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
The result of the operation.
ExecuteAsync(KernelExecutionContext, CancellationToken)
Gets execute asynchronously.
public ValueTask ExecuteAsync(KernelExecutionContext context, CancellationToken cancellationToken = default)
Parameters
contextKernelExecutionContextThe context.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask
The result of the operation.
ExecuteAsync(KernelArguments, CancellationToken)
Gets execute asynchronously.
public ValueTask ExecuteAsync(KernelArguments arguments, CancellationToken cancellationToken = default)
Parameters
argumentsKernelArgumentsThe arguments.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask
The result of the operation.
GetPerformanceMetrics()
Gets performance metrics for this kernel.
public ExecutionStatistics GetPerformanceMetrics()
Returns
SetCompiledDelegate(Delegate)
Sets the compiled delegate for direct kernel execution.
public void SetCompiledDelegate(Delegate compiledDelegate)
Parameters
compiledDelegateDelegate