Table of Contents

Class CudaCompiledRingKernel

Namespace
DotCompute.Backends.CUDA.RingKernels
Assembly
DotCompute.Backends.CUDA.dll

Represents a compiled Ring Kernel with PTX module and function pointer.

public sealed class CudaCompiledRingKernel : CompiledKernel, IDisposable
Inheritance
CudaCompiledRingKernel
Implements
Inherited Members
Extension Methods

Remarks

This class extends CompiledKernel with Ring Kernel-specific metadata including the discovered kernel information, PTX module handle, and kernel function pointer.

Lifecycle:

  1. Created by CudaRingKernelCompiler after successful compilation
  2. PTX module loaded into CUDA context
  3. Function pointer retrieved for cooperative kernel launch
  4. Module unloaded on disposal

Constructors

CudaCompiledRingKernel(DiscoveredRingKernel, nint, nint, ReadOnlyMemory<byte>, nint)

Initializes a new instance of the CudaCompiledRingKernel class.

public CudaCompiledRingKernel(DiscoveredRingKernel discoveredKernel, nint moduleHandle, nint functionPointer, ReadOnlyMemory<byte> ptxBytes, nint cudaContext)

Parameters

discoveredKernel DiscoveredRingKernel

The discovered kernel metadata.

moduleHandle nint

The PTX module handle.

functionPointer nint

The kernel function pointer.

ptxBytes ReadOnlyMemory<byte>

The PTX source code bytes.

cudaContext nint

The CUDA context.

Properties

CompilationTimestamp

Gets the compilation timestamp.

public DateTime CompilationTimestamp { get; }

Property Value

DateTime

CudaContext

Gets the CUDA context this kernel was compiled for.

public nint CudaContext { get; }

Property Value

nint

DiscoveredKernel

Gets the discovered kernel metadata from reflection.

public DiscoveredRingKernel DiscoveredKernel { get; }

Property Value

DiscoveredRingKernel

FunctionPointer

Gets the kernel function pointer for cooperative launch.

public nint FunctionPointer { get; }

Property Value

nint

IsValid

Gets a value indicating whether this kernel is valid for execution.

public bool IsValid { get; }

Property Value

bool

ModuleHandle

Gets the PTX module handle.

public nint ModuleHandle { get; }

Property Value

nint

PtxBytes

Gets the PTX source code bytes.

public ReadOnlyMemory<byte> PtxBytes { get; }

Property Value

ReadOnlyMemory<byte>

Methods

Dispose(bool)

Releases the unmanaged resources used by the CompiledKernel and optionally releases the managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

True to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

This method is called by the Dispose() method and the finalizer. Override this method in derived classes to provide specific resource cleanup logic.