Interface IMemoryPoolService
- Namespace
- DotCompute.Runtime.Services
- Assembly
- DotCompute.Runtime.dll
Service for managing memory pools across accelerators
public interface IMemoryPoolService
Methods
CreatePoolAsync(string, long, long)
Creates a new memory pool for an accelerator
Task<IMemoryPool> CreatePoolAsync(string acceleratorId, long initialSize, long maxSize)
Parameters
acceleratorIdstringThe accelerator identifier
initialSizelongThe initial pool size in bytes
maxSizelongThe maximum pool size in bytes
Returns
- Task<IMemoryPool>
The created memory pool
GetPool(string)
Gets a memory pool for the specified accelerator
IMemoryPool GetPool(string acceleratorId)
Parameters
acceleratorIdstringThe accelerator identifier
Returns
- IMemoryPool
The memory pool for the accelerator
GetUsageStatistics()
Gets memory usage statistics across all pools
MemoryUsageStatistics GetUsageStatistics()
Returns
- MemoryUsageStatistics
Memory usage statistics
OptimizeMemoryUsageAsync()
Optimizes memory usage across all pools
Task OptimizeMemoryUsageAsync()
Returns
- Task
A task representing the optimization operation
ReleaseUnusedMemoryAsync()
Releases unused memory from all pools
Task<long> ReleaseUnusedMemoryAsync()