Interface IUnifiedMemoryBuffer
- Namespace
- DotCompute.Abstractions
- Assembly
- DotCompute.Abstractions.dll
Non-generic base interface for memory buffers.
public interface IUnifiedMemoryBuffer : IAsyncDisposable, IDisposable
- Inherited Members
- Extension Methods
Properties
IsDisposed
Gets whether the buffer has been disposed.
bool IsDisposed { get; }
Property Value
Options
Gets the memory allocation options.
MemoryOptions Options { get; }
Property Value
SizeInBytes
Gets the size of the buffer in bytes.
long SizeInBytes { get; }
Property Value
State
Gets the current state of the buffer.
BufferState State { get; }
Property Value
Methods
CopyFromAsync<T>(ReadOnlyMemory<T>, long, CancellationToken)
Copies data from a source memory into this buffer.
ValueTask CopyFromAsync<T>(ReadOnlyMemory<T> source, long offset = 0, CancellationToken cancellationToken = default) where T : unmanaged
Parameters
sourceReadOnlyMemory<T>The source memory to copy from.
offsetlongThe offset in bytes where to start copying.
cancellationTokenCancellationTokenCancellation token.
Returns
- ValueTask
A task representing the copy operation.
Type Parameters
TThe element type.
CopyToAsync<T>(Memory<T>, long, CancellationToken)
Copies data from this buffer to a destination memory.
ValueTask CopyToAsync<T>(Memory<T> destination, long offset = 0, CancellationToken cancellationToken = default) where T : unmanaged
Parameters
destinationMemory<T>The destination memory to copy to.
offsetlongThe offset in bytes where to start copying from.
cancellationTokenCancellationTokenCancellation token.
Returns
- ValueTask
A task representing the copy operation.
Type Parameters
TThe element type.