Class UnifiedMemoryService
- Namespace
- DotCompute.Runtime.Services.Memory
- Assembly
- DotCompute.Runtime.dll
Implementation of unified memory service
public class UnifiedMemoryService : IUnifiedMemoryService
- Inheritance
-
UnifiedMemoryService
- Implements
- Inherited Members
Constructors
UnifiedMemoryService(ILogger<UnifiedMemoryService>)
Implementation of unified memory service
public UnifiedMemoryService(ILogger<UnifiedMemoryService> logger)
Parameters
loggerILogger<UnifiedMemoryService>
Methods
AllocateUnifiedAsync(long, params string[])
Gets allocate unified asynchronously.
public Task<IUnifiedMemoryBuffer> AllocateUnifiedAsync(long sizeInBytes, params string[] acceleratorIds)
Parameters
Returns
- Task<IUnifiedMemoryBuffer>
The result of the operation.
GetCoherenceStatus(IUnifiedMemoryBuffer)
Gets the coherence status.
public MemoryCoherenceStatus GetCoherenceStatus(IUnifiedMemoryBuffer buffer)
Parameters
bufferIUnifiedMemoryBufferThe buffer.
Returns
- MemoryCoherenceStatus
The coherence status.
MigrateAsync(IUnifiedMemoryBuffer, string, string)
Gets migrate asynchronously.
public Task MigrateAsync(IUnifiedMemoryBuffer buffer, string sourceAcceleratorId, string targetAcceleratorId)
Parameters
bufferIUnifiedMemoryBufferThe buffer.
sourceAcceleratorIdstringThe source accelerator identifier.
targetAcceleratorIdstringThe target accelerator identifier.
Returns
- Task
The result of the operation.
SynchronizeCoherenceAsync(IUnifiedMemoryBuffer, params string[])
Gets synchronize coherence asynchronously.
public Task SynchronizeCoherenceAsync(IUnifiedMemoryBuffer buffer, params string[] acceleratorIds)
Parameters
bufferIUnifiedMemoryBufferThe buffer.
acceleratorIdsstring[]The accelerator ids.
Returns
- Task
The result of the operation.