Interface IDeviceMemory
- Namespace
- Orleans.GpuBridge.Abstractions.Providers.Memory.Interfaces
- Assembly
- Orleans.GpuBridge.Abstractions.dll
Represents device memory allocation
public interface IDeviceMemory : IDisposable
- Inherited Members
Properties
Device
Associated device
IComputeDevice Device { get; }
Property Value
DevicePointer
Device pointer to the memory
nint DevicePointer { get; }
Property Value
SizeBytes
Size of the allocation in bytes
long SizeBytes { get; }
Property Value
Methods
CopyFromAsync(IDeviceMemory, long, long, long, CancellationToken)
Copies data between device allocations
Task CopyFromAsync(IDeviceMemory source, long sourceOffset, long destinationOffset, long sizeBytes, CancellationToken cancellationToken = default)
Parameters
sourceIDeviceMemorysourceOffsetlongdestinationOffsetlongsizeByteslongcancellationTokenCancellationToken
Returns
CopyFromHostAsync(nint, long, long, CancellationToken)
Copies data from host to device
Task CopyFromHostAsync(nint hostPointer, long offsetBytes, long sizeBytes, CancellationToken cancellationToken = default)
Parameters
hostPointernintoffsetByteslongsizeByteslongcancellationTokenCancellationToken
Returns
CopyToHostAsync(nint, long, long, CancellationToken)
Copies data from device to host
Task CopyToHostAsync(nint hostPointer, long offsetBytes, long sizeBytes, CancellationToken cancellationToken = default)
Parameters
hostPointernintoffsetByteslongsizeByteslongcancellationTokenCancellationToken
Returns
CreateView(long, long)
Creates a view into a portion of this memory
IDeviceMemory CreateView(long offsetBytes, long sizeBytes)
Parameters
Returns
FillAsync(byte, long, long, CancellationToken)
Fills the memory with a byte value
Task FillAsync(byte value, long offsetBytes, long sizeBytes, CancellationToken cancellationToken = default)
Parameters
valuebyteoffsetByteslongsizeByteslongcancellationTokenCancellationToken