Table of Contents

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

IComputeDevice

DevicePointer

Device pointer to the memory

nint DevicePointer { get; }

Property Value

nint

SizeBytes

Size of the allocation in bytes

long SizeBytes { get; }

Property Value

long

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

source IDeviceMemory
sourceOffset long
destinationOffset long
sizeBytes long
cancellationToken CancellationToken

Returns

Task

CopyFromHostAsync(nint, long, long, CancellationToken)

Copies data from host to device

Task CopyFromHostAsync(nint hostPointer, long offsetBytes, long sizeBytes, CancellationToken cancellationToken = default)

Parameters

hostPointer nint
offsetBytes long
sizeBytes long
cancellationToken CancellationToken

Returns

Task

CopyToHostAsync(nint, long, long, CancellationToken)

Copies data from device to host

Task CopyToHostAsync(nint hostPointer, long offsetBytes, long sizeBytes, CancellationToken cancellationToken = default)

Parameters

hostPointer nint
offsetBytes long
sizeBytes long
cancellationToken CancellationToken

Returns

Task

CreateView(long, long)

Creates a view into a portion of this memory

IDeviceMemory CreateView(long offsetBytes, long sizeBytes)

Parameters

offsetBytes long
sizeBytes long

Returns

IDeviceMemory

FillAsync(byte, long, long, CancellationToken)

Fills the memory with a byte value

Task FillAsync(byte value, long offsetBytes, long sizeBytes, CancellationToken cancellationToken = default)

Parameters

value byte
offsetBytes long
sizeBytes long
cancellationToken CancellationToken

Returns

Task