Class KernelDefinition
- Namespace
- DotCompute.Abstractions.Kernels
- Assembly
- DotCompute.Abstractions.dll
Represents a kernel definition that contains the source code and metadata necessary to compile and execute a compute kernel.
public class KernelDefinition
- Inheritance
-
KernelDefinition
- Inherited Members
Constructors
KernelDefinition()
Initializes a new instance of the KernelDefinition class.
public KernelDefinition()
KernelDefinition(string, string?, string?)
Initializes a new instance of the KernelDefinition class with the specified parameters.
[SetsRequiredMembers]
public KernelDefinition(string name, string? source, string? entryPoint = null)
Parameters
namestringThe unique name for the kernel.
sourcestringThe kernel source code.
entryPointstringThe entry point function name. If null, defaults to "main".
Properties
Code
Gets or sets the kernel code (alias for Source for compatibility).
public string? Code { get; init; }
Property Value
- string
The kernel source code, identical to the Source property.
EntryFunction
Gets or sets the entry function name for kernel execution (alias for EntryPoint).
public string EntryFunction { get; init; }
Property Value
- string
The name of the function to call when executing the kernel.
EntryPoint
Gets or sets the entry point function name for kernel execution.
public string EntryPoint { get; init; }
Property Value
- string
The name of the function to call when executing the kernel. Defaults to "main".
Language
Gets or sets the kernel programming language.
public KernelLanguage Language { get; init; }
Property Value
- KernelLanguage
The language used to write the kernel source code.
Metadata
Gets or sets kernel metadata for additional configuration and information.
public Dictionary<string, object> Metadata { get; init; }
Property Value
- Dictionary<string, object>
A dictionary containing kernel-specific metadata such as compilation flags, device constraints, or custom attributes.
Name
Gets or sets the unique name identifier for this kernel.
public required string Name { get; init; }
Property Value
- string
The kernel name used for identification and compilation.
Source
Gets or sets the kernel source code.
public string? Source { get; init; }
Property Value
- string
The source code string containing the kernel implementation.