Class CudaMemoryTracker
- Namespace
- DotCompute.Backends.CUDA.Types
- Assembly
- DotCompute.Backends.CUDA.dll
CUDA memory manager for device memory allocation and management.
public sealed class CudaMemoryTracker : IAsyncDisposable, IDisposable
- Inheritance
-
CudaMemoryTracker
- Implements
- Inherited Members
- Extension Methods
Constructors
CudaMemoryTracker(CudaContext, ILogger)
Initializes a new instance of the CudaMemoryTracker class.
public CudaMemoryTracker(CudaContext context, ILogger logger)
Parameters
contextCudaContextloggerILogger
Properties
Context
Gets or sets the associated CUDA context.
public nint Context { get; set; }
Property Value
DeviceIndex
Gets or sets the device index.
public int DeviceIndex { get; set; }
Property Value
MaxAllocationSize
Gets the maximum allocation size.
public long MaxAllocationSize { get; set; }
Property Value
TotalAllocatedBytes
Gets or sets the total allocated memory in bytes.
public long TotalAllocatedBytes { get; set; }
Property Value
TotalMemory
Gets the total memory available on the device.
public long TotalMemory { get; set; }
Property Value
UsedMemory
Gets the currently used memory.
public long UsedMemory { get; set; }
Property Value
Methods
Dispose()
Synchronously disposes the memory manager and all allocated resources.
public void Dispose()
DisposeAsync()
Asynchronously disposes the memory manager and all allocated resources.
public ValueTask DisposeAsync()
Returns
Reset()
Resets the memory manager and clears all memory pools.
public void Reset()