Table of Contents

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

acceleratorId string

The accelerator identifier

initialSize long

The initial pool size in bytes

maxSize long

The 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

acceleratorId string

The 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()

Returns

Task<long>

The amount of memory released in bytes