Table of Contents

Class CudaStreamHandle

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

Handle for managed CUDA streams with automatic cleanup.

[SuppressMessage("Design", "CA1063:Implement IDisposable Correctly", Justification = "Dispose pattern is correctly implemented for this unsealed type")]
public class CudaStreamHandle : IDisposable
Inheritance
CudaStreamHandle
Implements
Inherited Members
Extension Methods

Remarks

Implements RAII pattern for CUDA stream lifecycle management with pool return support.

Constructors

CudaStreamHandle(StreamId, nint, bool, Action<StreamId>?, Action<nint>?)

public CudaStreamHandle(StreamId streamId, nint cudaStream, bool isFromPool = false, Action<StreamId>? onDispose = null, Action<nint>? returnToPool = null)

Parameters

streamId StreamId
cudaStream nint
isFromPool bool
onDispose Action<StreamId>
returnToPool Action<nint>

Properties

CudaStream

public nint CudaStream { get; }

Property Value

nint

IsFromPool

public bool IsFromPool { get; }

Property Value

bool

Stream

public nint Stream { get; }

Property Value

nint

StreamId

public StreamId StreamId { get; }

Property Value

StreamId

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool