Table of Contents

Interface ICompilationMetadata

Namespace
DotCompute.Abstractions.Interfaces.Compute
Assembly
DotCompute.Abstractions.dll

Provides compilation metadata for kernels, including timing information, options used, and compilation results. This interface enables inspection of compilation details for debugging, profiling, and optimization purposes.

public interface ICompilationMetadata

Remarks

Compilation metadata is generated during the kernel compilation process and provides valuable information about how the kernel was compiled, what optimizations were applied, and any warnings or issues encountered during compilation.

Properties

CompilationTime

Gets the timestamp when the kernel compilation was completed.

DateTimeOffset CompilationTime { get; }

Property Value

DateTimeOffset

A DateTimeOffset representing the exact time when kernel compilation finished. This timestamp uses UTC offset to ensure consistency across different time zones.

Remarks

This timestamp can be used for cache validation, debugging compilation issues, and tracking kernel compilation performance over time.

OptimizationLevel

Gets the optimization level that was applied during compilation.

OptimizationLevel OptimizationLevel { get; }

Property Value

OptimizationLevel

An OptimizationLevel enumeration value indicating the level of optimization applied to the kernel code during compilation. This affects both compilation time and runtime performance of the generated code.

Remarks

The optimization level determines trade-offs between compilation time, code size, and runtime performance. Higher optimization levels generally produce faster executing code at the cost of longer compilation times.

Options

Gets the compilation options that were used during kernel compilation.

CompilationOptions Options { get; }

Property Value

CompilationOptions

A CompilationOptions object containing all the settings and flags that were applied during the compilation process, including optimization levels, debug settings, and target-specific configurations.

Remarks

These options directly affect the generated code quality, performance characteristics, and debugging capabilities of the compiled kernel.

Warnings

Gets any compilation warnings that were generated during the kernel compilation process.

IReadOnlyList<string> Warnings { get; }

Property Value

IReadOnlyList<string>

An array of strings containing human-readable warning messages. Each warning describes a non-critical issue or potential optimization opportunity identified during compilation. An empty array indicates no warnings were generated.

Remarks

Warnings do not prevent successful compilation but may indicate potential performance issues, deprecated usage patterns, or opportunities for code improvement. These messages are typically formatted for developer consumption and may include line numbers and specific recommendations.