Table of Contents

Interface IGpuMemory<T>

Namespace
Orleans.GpuBridge.Abstractions.Memory
Assembly
Orleans.GpuBridge.Abstractions.dll

Represents GPU memory allocation

public interface IGpuMemory<T> : IDisposable where T : unmanaged

Type Parameters

T
Inherited Members

Properties

DeviceIndex

Gets the device index this memory is allocated on

int DeviceIndex { get; }

Property Value

int

IsResident

Gets whether this memory is currently on the device

bool IsResident { get; }

Property Value

bool

Length

Gets the number of elements in the memory

int Length { get; }

Property Value

int

SizeInBytes

Gets the size in bytes

long SizeInBytes { get; }

Property Value

long

Methods

AsMemory()

Gets memory as a span for CPU access

Memory<T> AsMemory()

Returns

Memory<T>

CopyFromDeviceAsync(CancellationToken)

Copies data from device to CPU

ValueTask CopyFromDeviceAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

ValueTask

CopyToDeviceAsync(CancellationToken)

Copies data from CPU to device

ValueTask CopyToDeviceAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

ValueTask