Interface IMemoryPool
- Namespace
- DotCompute.Runtime.Services
- Assembly
- DotCompute.Runtime.dll
Memory pool interface
public interface IMemoryPool : IDisposable
- Inherited Members
- Extension Methods
Properties
AcceleratorId
Gets the accelerator ID this pool belongs to
string AcceleratorId { get; }
Property Value
AvailableSize
Gets the available size in bytes
long AvailableSize { get; }
Property Value
TotalSize
Gets the total pool size in bytes
long TotalSize { get; }
Property Value
UsedSize
Gets the used size in bytes
long UsedSize { get; }
Property Value
Methods
AllocateAsync(long)
Allocates memory from the pool
Task<IUnifiedMemoryBuffer> AllocateAsync(long sizeInBytes)
Parameters
sizeInByteslongThe size to allocate
Returns
- Task<IUnifiedMemoryBuffer>
The allocated memory buffer
DefragmentAsync()
Defragments the memory pool
Task DefragmentAsync()
Returns
- Task
A task representing the defragmentation operation
GetStatistics()
Gets pool statistics
MemoryPoolStatistics GetStatistics()
Returns
- MemoryPoolStatistics
Pool statistics
ReturnAsync(IUnifiedMemoryBuffer)
Returns memory to the pool
Task ReturnAsync(IUnifiedMemoryBuffer buffer)
Parameters
bufferIUnifiedMemoryBufferThe memory buffer to return
Returns
- Task
A task representing the return operation