Interface IDeviceMemory<T>
- Namespace
- Orleans.GpuBridge.Abstractions.Providers.Memory.Interfaces
- Assembly
- Orleans.GpuBridge.Abstractions.dll
Typed device memory allocation
public interface IDeviceMemory<T> : IDeviceMemory, IDisposable where T : unmanaged
Type Parameters
T
- Inherited Members
Properties
Length
Number of elements
int Length { get; }
Property Value
Methods
AsSpan()
Gets a span view of the memory (if accessible from host)
Span<T> AsSpan()
Returns
- Span<T>
CopyFromHostAsync(T[], int, int, int, CancellationToken)
Copies data from host array to device
Task CopyFromHostAsync(T[] source, int sourceOffset, int destinationOffset, int count, CancellationToken cancellationToken = default)
Parameters
sourceT[]sourceOffsetintdestinationOffsetintcountintcancellationTokenCancellationToken
Returns
CopyToHostAsync(T[], int, int, int, CancellationToken)
Copies data from device to host array
Task CopyToHostAsync(T[] destination, int sourceOffset, int destinationOffset, int count, CancellationToken cancellationToken = default)
Parameters
destinationT[]sourceOffsetintdestinationOffsetintcountintcancellationTokenCancellationToken
Returns
FillAsync(T, int, int, CancellationToken)
Fills the memory with a value
Task FillAsync(T value, int offset, int count, CancellationToken cancellationToken = default)
Parameters
valueToffsetintcountintcancellationTokenCancellationToken