Class MetalEventPool
- Namespace
- DotCompute.Backends.Metal.Execution
- Assembly
- DotCompute.Backends.Metal.dll
Efficient pool for managing Metal events to reduce allocation overhead and improve performance. Follows CUDA event pool patterns with Metal-specific optimizations.
public sealed class MetalEventPool : IDisposable
- Inheritance
-
MetalEventPool
- Implements
- Inherited Members
- Extension Methods
Constructors
MetalEventPool(nint, ILogger<MetalEventManager>)
public MetalEventPool(nint device, ILogger<MetalEventManager> logger)
Parameters
devicenintloggerILogger<MetalEventManager>
Properties
Statistics
Gets statistics about the event pools
public MetalEventPoolStatistics Statistics { get; }
Property Value
Methods
AcquireSyncEventAsync(CancellationToken)
Acquires a synchronization event from the pool or creates a new one
public Task<nint> AcquireSyncEventAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
AcquireTimingEventAsync(CancellationToken)
Acquires a timing event from the pool or creates a new one
public Task<nint> AcquireTimingEventAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetStatistics()
Gets statistics about the event pool (API compatibility method).
public MetalEventPoolStatistics GetStatistics()
Returns
PerformMaintenance()
Performs maintenance on the event pools
public void PerformMaintenance()
Return(nint, MetalEventType)
Returns an event to the appropriate pool for reuse
public void Return(nint eventHandle, MetalEventType eventType)
Parameters
eventHandleninteventTypeMetalEventType