Table of Contents

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

context CudaContext
logger ILogger

Properties

Context

Gets or sets the associated CUDA context.

public nint Context { get; set; }

Property Value

nint

DeviceIndex

Gets or sets the device index.

public int DeviceIndex { get; set; }

Property Value

int

MaxAllocationSize

Gets the maximum allocation size.

public long MaxAllocationSize { get; set; }

Property Value

long

TotalAllocatedBytes

Gets or sets the total allocated memory in bytes.

public long TotalAllocatedBytes { get; set; }

Property Value

long

TotalMemory

Gets the total memory available on the device.

public long TotalMemory { get; set; }

Property Value

long

UsedMemory

Gets the currently used memory.

public long UsedMemory { get; set; }

Property Value

long

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

ValueTask

Reset()

Resets the memory manager and clears all memory pools.

public void Reset()