Table of Contents

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

code string

The source code text containing the kernel implementation.

name string

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

language KernelLanguage

The programming language of the source code (defaults to CSharpIL).

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

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

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