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:
- Created by CudaRingKernelCompiler after successful compilation
- PTX module loaded into CUDA context
- Function pointer retrieved for cooperative kernel launch
- 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
discoveredKernelDiscoveredRingKernelThe discovered kernel metadata.
moduleHandlenintThe PTX module handle.
functionPointernintThe kernel function pointer.
ptxBytesReadOnlyMemory<byte>The PTX source code bytes.
cudaContextnintThe CUDA context.
Properties
CompilationTimestamp
Gets the compilation timestamp.
public DateTime CompilationTimestamp { get; }
Property Value
CudaContext
Gets the CUDA context this kernel was compiled for.
public nint CudaContext { get; }
Property Value
DiscoveredKernel
Gets the discovered kernel metadata from reflection.
public DiscoveredRingKernel DiscoveredKernel { get; }
Property Value
FunctionPointer
Gets the kernel function pointer for cooperative launch.
public nint FunctionPointer { get; }
Property Value
IsValid
Gets a value indicating whether this kernel is valid for execution.
public bool IsValid { get; }
Property Value
ModuleHandle
Gets the PTX module handle.
public nint ModuleHandle { get; }
Property Value
PtxBytes
Gets the PTX source code bytes.
public ReadOnlyMemory<byte> PtxBytes { get; }
Property Value
Methods
Dispose(bool)
Releases the unmanaged resources used by the CompiledKernel and optionally releases the managed resources.
protected override void Dispose(bool disposing)
Parameters
disposingboolTrue 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.