Table of Contents

Interface IKernelCompilationPort

Namespace
DotCompute.Abstractions.Ports
Assembly
DotCompute.Abstractions.dll

Port interface for kernel compilation operations. Part of hexagonal architecture - defines the contract that backend adapters must implement.

public interface IKernelCompilationPort

Remarks

This port abstracts kernel compilation from backend-specific implementations. Each backend (CUDA, Metal, OpenCL, CPU) provides an adapter that implements this interface.

Hexagonal Architecture: This is a "driven port" - the application core defines this interface and backend adapters implement it.

Properties

Capabilities

Gets the compilation capabilities of this backend.

KernelCompilationCapabilities Capabilities { get; }

Property Value

KernelCompilationCapabilities

Methods

CompileAsync(KernelSource, KernelCompilationOptions, CancellationToken)

Compiles kernel source code to an executable form.

ValueTask<ICompiledKernel> CompileAsync(KernelSource source, KernelCompilationOptions options, CancellationToken cancellationToken = default)

Parameters

source KernelSource

The kernel source code.

options KernelCompilationOptions

Compilation options.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask<ICompiledKernel>

The compiled kernel ready for execution.

ValidateAsync(KernelSource, CancellationToken)

Validates kernel source without full compilation.

ValueTask<KernelValidationResult> ValidateAsync(KernelSource source, CancellationToken cancellationToken = default)

Parameters

source KernelSource

The kernel source to validate.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask<KernelValidationResult>

Validation result with any errors or warnings.