Table of Contents

Class P2PTransferScheduler

Namespace
DotCompute.Core.Memory
Assembly
DotCompute.Core.dll

Advanced P2P transfer scheduler that optimizes bandwidth usage and coordinates transfers. Implements bandwidth-optimal scheduling, concurrent transfer management, and synchronization.

public sealed class P2PTransferScheduler : IAsyncDisposable
Inheritance
P2PTransferScheduler
Implements
Inherited Members

Constructors

P2PTransferScheduler(ILogger)

Initializes a new instance of the P2PTransferScheduler class.

public P2PTransferScheduler(ILogger logger)

Parameters

logger ILogger

The logger.

Properties

PendingTransferCount

Gets the number of pending transfers.

public int PendingTransferCount { get; }

Property Value

int

Methods

DisposeAsync()

Gets dispose asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

The result of the operation.

GetStatistics()

Gets comprehensive transfer statistics.

public TransferStatistics GetStatistics()

Returns

TransferStatistics

ScheduleP2PTransferAsync<T>(IUnifiedMemoryBuffer<T>, IUnifiedMemoryBuffer<T>, int, int, int, TransferStrategy, CancellationToken)

Schedules a P2P-optimized transfer with bandwidth management.

public ValueTask ScheduleP2PTransferAsync<T>(IUnifiedMemoryBuffer<T> sourceBuffer, IUnifiedMemoryBuffer<T> targetBuffer, int sourceOffset, int targetOffset, int elementCount, TransferStrategy strategy, CancellationToken cancellationToken = default) where T : unmanaged

Parameters

sourceBuffer IUnifiedMemoryBuffer<T>
targetBuffer IUnifiedMemoryBuffer<T>
sourceOffset int
targetOffset int
elementCount int
strategy TransferStrategy
cancellationToken CancellationToken

Returns

ValueTask

Type Parameters

T

WaitForDeviceTransfersAsync(string, CancellationToken)

Waits for all pending transfers to a specific device to complete.

public ValueTask WaitForDeviceTransfersAsync(string deviceId, CancellationToken cancellationToken)

Parameters

deviceId string
cancellationToken CancellationToken

Returns

ValueTask