Class KernelExecutionContext
- Namespace
- DotCompute.Abstractions.Execution
- Assembly
- DotCompute.Abstractions.dll
Represents the execution context for a kernel.
public class KernelExecutionContext
- Inheritance
-
KernelExecutionContext
- Inherited Members
Properties
AcceleratorId
Gets or sets the target accelerator for execution.
public string? AcceleratorId { get; set; }
Property Value
Buffers
Gets or sets the memory buffers for this execution context.
public Dictionary<int, IUnifiedMemoryBuffer<byte>> Buffers { get; }
Property Value
CompilationInfo
Gets or sets compilation information for the kernel.
public string? CompilationInfo { get; set; }
Property Value
EnableDebugMode
Gets or sets a value indicating whether to enable debug mode for this execution.
public bool EnableDebugMode { get; set; }
Property Value
EnableProfiling
Gets or sets a value indicating whether to enable profiling for this execution.
public bool EnableProfiling { get; set; }
Property Value
ExecutionId
Gets or sets the unique identifier for this execution context.
public Guid ExecutionId { get; set; }
Property Value
KernelName
Gets or sets the name of the kernel being executed.
public string? KernelName { get; set; }
Property Value
LocalWorkSize
Gets or sets the local work size for kernel execution.
public Dim3 LocalWorkSize { get; set; }
Property Value
MemoryOptimizationLevel
Gets or sets the memory optimization level for this execution.
public MemoryOptimizationLevel MemoryOptimizationLevel { get; set; }
Property Value
Name
Gets or sets the kernel name (alias for KernelName).
public string? Name { get; set; }
Property Value
OptimizationLevel
Gets or sets the optimization level for this execution.
public OptimizationLevel OptimizationLevel { get; set; }
Property Value
Parameters
Gets or sets additional execution parameters.
public Dictionary<string, object> Parameters { get; }
Property Value
Scalars
Gets or sets the scalar parameters for this execution context.
public Dictionary<int, object> Scalars { get; }
Property Value
TimeoutMilliseconds
Gets or sets the maximum execution time in milliseconds.
public int? TimeoutMilliseconds { get; set; }
Property Value
- int?
Timestamp
Gets or sets the timestamp when this context was created.
public DateTime Timestamp { get; set; }
Property Value
WorkDimensions
Gets or sets the work dimensions for kernel execution.
public Dim3 WorkDimensions { get; set; }
Property Value
Methods
CreateDefault()
Creates a default execution context.
public static KernelExecutionContext CreateDefault()
Returns
- KernelExecutionContext
A new instance of KernelExecutionContext with default settings.
GetBuffer(KernelExecutionContext, int)
Gets a buffer parameter by index (static access).
public static IUnifiedMemoryBuffer<byte>? GetBuffer(KernelExecutionContext context, int index)
Parameters
contextKernelExecutionContextThe execution context.
indexintThe buffer index.
Returns
- IUnifiedMemoryBuffer<byte>
The memory buffer.
GetBuffer(int)
Gets a buffer parameter by index.
public IUnifiedMemoryBuffer<byte>? GetBuffer(int index)
Parameters
indexintThe buffer index.
Returns
- IUnifiedMemoryBuffer<byte>
The memory buffer.
GetScalar<T>(int)
Gets a scalar parameter by index.
public T? GetScalar<T>(int index)
Parameters
indexintThe parameter index.
Returns
- T
The scalar value.
Type Parameters
TThe scalar type.
SetParameter(int, object)
Sets a parameter value for the kernel execution.
public void SetParameter(int index, object value)