Table of Contents

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

int

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

source T[]
sourceOffset int
destinationOffset int
count int
cancellationToken CancellationToken

Returns

Task

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

destination T[]
sourceOffset int
destinationOffset int
count int
cancellationToken CancellationToken

Returns

Task

FillAsync(T, int, int, CancellationToken)

Fills the memory with a value

Task FillAsync(T value, int offset, int count, CancellationToken cancellationToken = default)

Parameters

value T
offset int
count int
cancellationToken CancellationToken

Returns

Task