Table of Contents

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

bytecode byte[]

The binary data containing the compiled kernel bytecode.

name string

The name identifier for the kernel (defaults to "main").

language KernelLanguage

The bytecode format or target language (defaults to Binary).

entryPoint string

The entry point method name for kernel execution (defaults to "main").

dependencies string[]

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

string

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

IReadOnlyList<string>

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

string

Language

Gets the kernel language or source type format. Specifies the programming language, assembly format, or bytecode type.

public KernelLanguage Language { get; }

Property Value

KernelLanguage

Name

Gets the unique name identifier for the kernel. This name is used for identification and debugging purposes.

public string Name { get; }

Property Value

string