Table of Contents

Interface IPinnedMemoryBuffer<T>

Namespace
DotCompute.Backends.CUDA.Memory
Assembly
DotCompute.Backends.CUDA.dll

Interface for pinned memory buffers.

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

Type Parameters

T
Inherited Members
Extension Methods

Properties

Count

Gets or sets the count.

long Count { get; }

Property Value

long

The count.

DevicePointer

Gets or sets the device pointer.

nint DevicePointer { get; }

Property Value

nint

The device pointer.

HostPointer

Gets or sets the host pointer.

nint HostPointer { get; }

Property Value

nint

The host pointer.

Methods

AsMemory()

Gets as memory.

Memory<T> AsMemory()

Returns

Memory<T>

The result of the operation.

AsSpan()

Gets as span.

Span<T> AsSpan()

Returns

Span<T>

The result of the operation.

CopyFromDeviceAsync(nint, CancellationToken)

Gets copy from device asynchronously.

Task CopyFromDeviceAsync(nint devicePtr, CancellationToken cancellationToken = default)

Parameters

devicePtr nint

The device ptr.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

The result of the operation.

CopyToDeviceAsync(nint, CancellationToken)

Gets copy to device asynchronously.

Task CopyToDeviceAsync(nint devicePtr, CancellationToken cancellationToken = default)

Parameters

devicePtr nint

The device ptr.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

The result of the operation.