Class BytecodeKernelSource
- Namespace
- DotCompute.Abstractions.Kernels
- Assembly
- DotCompute.Abstractions.dll
Represents a kernel source from bytecode or binary data. Provides implementation for kernels defined using pre-compiled bytecode, assembly, or binary executable formats.
public class BytecodeKernelSource : IKernelSource
- Inheritance
-
BytecodeKernelSource
- Implements
- Inherited Members
Constructors
BytecodeKernelSource(byte[], string, KernelLanguage, string, params string[])
Initializes a new instance of the BytecodeKernelSource class.
public BytecodeKernelSource(byte[] bytecode, string name = "main", KernelLanguage language = KernelLanguage.Binary, string entryPoint = "main", params string[] dependencies)
Parameters
bytecodebyte[]The binary data containing the compiled kernel bytecode.
namestringThe name identifier for the kernel (defaults to "main").
languageKernelLanguageThe bytecode format or target language (defaults to Binary).
entryPointstringThe entry point method name for kernel execution (defaults to "main").
dependenciesstring[]Optional array of dependency identifiers required by this kernel.
Exceptions
- ArgumentNullException
Thrown when bytecode is null.
- ArgumentException
Thrown when bytecode is empty, name is null/empty, or entryPoint is null/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; }