Table of Contents

Interface IUnifiedMemoryService

Namespace
DotCompute.Runtime.Services.Interfaces
Assembly
DotCompute.Runtime.dll

Service for managing unified memory across different accelerators

public interface IUnifiedMemoryService

Methods

AllocateUnifiedAsync(long, params string[])

Allocates unified memory that can be accessed by multiple accelerators

Task<IUnifiedMemoryBuffer> AllocateUnifiedAsync(long sizeInBytes, params string[] acceleratorIds)

Parameters

sizeInBytes long

The size in bytes

acceleratorIds string[]

The accelerator IDs that will access this memory

Returns

Task<IUnifiedMemoryBuffer>

The allocated unified memory buffer

GetCoherenceStatus(IUnifiedMemoryBuffer)

Gets memory coherence status for a buffer

MemoryCoherenceStatus GetCoherenceStatus(IUnifiedMemoryBuffer buffer)

Parameters

buffer IUnifiedMemoryBuffer

The memory buffer

Returns

MemoryCoherenceStatus

The coherence status

MigrateAsync(IUnifiedMemoryBuffer, string, string)

Migrates data between accelerators

Task MigrateAsync(IUnifiedMemoryBuffer buffer, string sourceAcceleratorId, string targetAcceleratorId)

Parameters

buffer IUnifiedMemoryBuffer

The memory buffer to migrate

sourceAcceleratorId string

The source accelerator ID

targetAcceleratorId string

The target accelerator ID

Returns

Task

A task representing the migration operation

SynchronizeCoherenceAsync(IUnifiedMemoryBuffer, params string[])

Synchronizes memory coherence across accelerators

Task SynchronizeCoherenceAsync(IUnifiedMemoryBuffer buffer, params string[] acceleratorIds)

Parameters

buffer IUnifiedMemoryBuffer

The memory buffer to synchronize

acceleratorIds string[]

The accelerator IDs to synchronize

Returns

Task

A task representing the synchronization operation