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
streamIdStreamIdcudaStreamnintisFromPoolboolonDisposeAction<StreamId>returnToPoolAction<nint>
Properties
CudaStream
public nint CudaStream { get; }
Property Value
IsFromPool
public bool IsFromPool { get; }
Property Value
Stream
public nint Stream { get; }
Property Value
StreamId
public StreamId StreamId { get; }
Property Value
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
disposingbool