Interface IUnifiedMemoryService
- Namespace
- DotCompute.Runtime.Services
- 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
sizeInByteslongThe size in bytes
acceleratorIdsstring[]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
bufferIUnifiedMemoryBufferThe memory buffer
Returns
- MemoryCoherenceStatus
The coherence status
MigrateAsync(IUnifiedMemoryBuffer, string, string)
Migrates data between accelerators
Task MigrateAsync(IUnifiedMemoryBuffer buffer, string sourceAcceleratorId, string targetAcceleratorId)
Parameters
bufferIUnifiedMemoryBufferThe memory buffer to migrate
sourceAcceleratorIdstringThe source accelerator ID
targetAcceleratorIdstringThe 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
bufferIUnifiedMemoryBufferThe memory buffer to synchronize
acceleratorIdsstring[]The accelerator IDs to synchronize
Returns
- Task
A task representing the synchronization operation