Class CudaContext
- Namespace
- DotCompute.Backends.CUDA
- Assembly
- DotCompute.Backends.CUDA.dll
Manages CUDA context lifecycle and operations
public sealed class CudaContext : IDisposable
- Inheritance
-
CudaContext
- Implements
- Inherited Members
- Extension Methods
Constructors
CudaContext(int)
Initializes a new instance of the CudaContext class.
public CudaContext(int deviceId)
Parameters
deviceIdintThe device identifier.
CudaContext(nint, int)
Initializes a new instance of the CudaContext class.
public CudaContext(nint contextPtr, int deviceId)
Parameters
Properties
DeviceId
Gets or sets the device identifier.
public int DeviceId { get; }
Property Value
- int
The device id.
Handle
Gets or sets the handle.
public nint Handle { get; }
Property Value
- nint
The handle.
Stream
Gets or sets the stream.
public nint Stream { get; }
Property Value
- nint
The stream.
Methods
Dispose()
Performs dispose.
public void Dispose()
MakeCurrent()
Performs make current.
public void MakeCurrent()
Reinitialize()
Performs reinitialize.
public void Reinitialize()
Synchronize()
Performs synchronize.
public void Synchronize()
ToIAccelerator()
Converts this CudaContext to an IAccelerator
public IAccelerator ToIAccelerator()