Table of Contents

Class P2PMemoryCoherenceManager

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

Advanced P2P memory coherence manager that maintains consistency across multiple GPU devices. Handles lazy synchronization, conflict resolution, and access pattern optimization.

public sealed class P2PMemoryCoherenceManager : IAsyncDisposable
Inheritance
P2PMemoryCoherenceManager
Implements
Inherited Members

Constructors

P2PMemoryCoherenceManager(ILogger)

Initializes a new instance of the P2PMemoryCoherenceManager class.

public P2PMemoryCoherenceManager(ILogger logger)

Parameters

logger ILogger

The logger.

Properties

OverheadPercentage

Gets coherence overhead percentage.

public double OverheadPercentage { get; }

Property Value

double

Methods

DisposeAsync()

Gets dispose asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

The result of the operation.

GetStatistics()

Gets comprehensive coherence statistics.

public CoherenceStatistics GetStatistics()

Returns

CoherenceStatistics

OptimizeP2PPlacementAsync(IAccelerator[], Dictionary<string, Dictionary<string, P2PConnectionCapability>>, CancellationToken)

Optimizes buffer placement based on P2P topology and access patterns.

public ValueTask OptimizeP2PPlacementAsync(IAccelerator[] devices, Dictionary<string, Dictionary<string, P2PConnectionCapability>> p2pMatrix, CancellationToken cancellationToken = default)

Parameters

devices IAccelerator[]
p2pMatrix Dictionary<string, Dictionary<string, P2PConnectionCapability>>
cancellationToken CancellationToken

Returns

ValueTask

RecordBufferAccess<T>(IUnifiedMemoryBuffer<T>, AccessType)

Records a buffer access for coherence tracking and optimization.

public void RecordBufferAccess<T>(IUnifiedMemoryBuffer<T> buffer, AccessType accessType) where T : unmanaged

Parameters

buffer IUnifiedMemoryBuffer<T>
accessType AccessType

Type Parameters

T

SynchronizeBufferAsync<T>(IUnifiedMemoryBuffer<T>, CancellationToken)

Synchronizes a buffer across all devices that have copies of it.

public ValueTask SynchronizeBufferAsync<T>(IUnifiedMemoryBuffer<T> buffer, CancellationToken cancellationToken = default) where T : unmanaged

Parameters

buffer IUnifiedMemoryBuffer<T>
cancellationToken CancellationToken

Returns

ValueTask

Type Parameters

T

TrackP2PBuffer<T>(P2PBuffer<T>, IUnifiedMemoryBuffer<T>, int, int, P2PConnectionCapability?)

Tracks a P2P buffer with coherence information and topology awareness.

public void TrackP2PBuffer<T>(P2PBuffer<T> buffer, IUnifiedMemoryBuffer<T> sourceBuffer, int offset, int count, P2PConnectionCapability? p2pCapability) where T : unmanaged

Parameters

buffer P2PBuffer<T>
sourceBuffer IUnifiedMemoryBuffer<T>
offset int
count int
p2pCapability P2PConnectionCapability

Type Parameters

T