Table of Contents

Class CachedKernel

Namespace
DotCompute.Backends.CUDA.Types
Assembly
DotCompute.Backends.CUDA.dll

Represents cached kernel compilation data.

public sealed class CachedKernel
Inheritance
CachedKernel
Inherited Members

Properties

AccessCount

Gets or sets the number of times this cached kernel has been accessed.

public int AccessCount { get; set; }

Property Value

int

Remarks

This property tracks usage frequency and can be used for cache statistics and eviction policies that favor frequently used kernels.

Architecture

Gets or sets the target architecture.

public string Architecture { get; set; }

Property Value

string

Binary

Gets or sets the compiled kernel binary.

public IReadOnlyList<byte> Binary { get; set; }

Property Value

IReadOnlyList<byte>

CacheKey

Gets or sets the unique cache key for this kernel.

public string CacheKey { get; set; }

Property Value

string

Remarks

The cache key is typically generated from the kernel source code hash, compilation options hash, and target architecture to ensure uniqueness.

CompilationTime

Gets or sets the compilation timestamp.

public DateTime CompilationTime { get; set; }

Property Value

DateTime

CreatedAt

Gets or sets the timestamp when this kernel cache entry was created.

public DateTime CreatedAt { get; set; }

Property Value

DateTime

Remarks

This timestamp is set when the kernel is first added to the cache and is used for cache aging and statistics.

Kernel

Gets or sets the compiled kernel instance.

public CompiledKernel? Kernel { get; set; }

Property Value

CompiledKernel

LastAccessTime

Gets or sets the last time this cached kernel was accessed.

public DateTime LastAccessTime { get; set; }

Property Value

DateTime

Remarks

This property is used for cache eviction policies such as Least Recently Used (LRU). It's updated automatically when the kernel is retrieved from the cache.

Name

Gets or sets the kernel name.

public string Name { get; set; }

Property Value

string

OptionsHash

Gets or sets the compilation options hash.

public string OptionsHash { get; set; }

Property Value

string

Size

Gets or sets the size of the cached kernel data in bytes.

public long Size { get; set; }

Property Value

long

Remarks

This includes the size of the compiled binary and any associated metadata. Used for memory management and cache size tracking.

SourceHash

Gets or sets the source code hash.

public string SourceHash { get; set; }

Property Value

string