Class TextKernelSource
- Namespace
- DotCompute.Abstractions.Kernels
- Assembly
- DotCompute.Abstractions.dll
Represents a kernel source from text-based code. Provides implementation for kernels defined using human-readable source code in various programming languages and formats.
public class TextKernelSource : IKernelSource
- Inheritance
-
TextKernelSource
- Implements
- Inherited Members
Constructors
TextKernelSource(string, string, KernelLanguage, string, params string[])
Initializes a new instance of the TextKernelSource class.
public TextKernelSource(string code, string name = "main", KernelLanguage language = KernelLanguage.CSharpIL, string entryPoint = "main", params string[] dependencies)
Parameters
codestringThe source code text containing the kernel implementation.
namestringThe name identifier for the kernel (defaults to "main").
languageKernelLanguageThe programming language of the source code (defaults to CSharpIL).
entryPointstringThe entry point method name for kernel execution (defaults to "main").
dependenciesstring[]Optional array of dependency identifiers required by this kernel.
Exceptions
- ArgumentException
Thrown when code, name, or entryPoint is null or empty.
Properties
Code
Gets the source code or bytecode representation of the kernel. For text-based sources, this contains the actual source code. For binary sources, this contains a Base64-encoded representation.
public string Code { get; }
Property Value
Dependencies
Gets the read-only list of dependency identifiers required by this kernel. Dependencies may include libraries, headers, or other kernel modules.
public IReadOnlyList<string> Dependencies { get; }
Property Value
EntryPoint
Gets the entry point method name for kernel execution. This is the function name that will be invoked when the kernel runs.
public string EntryPoint { get; }
Property Value
Language
Gets the kernel language or source type format. Specifies the programming language, assembly format, or bytecode type.
public KernelLanguage Language { get; }
Property Value
Name
Gets the unique name identifier for the kernel. This name is used for identification and debugging purposes.
public string Name { get; }