Table of Contents

Class OpenCLStreamPool

Namespace
DotCompute.Backends.OpenCL.Execution
Assembly
DotCompute.Backends.OpenCL.dll

Pool of command queues for efficient reuse. Provides a simplified interface delegating to OpenCLStreamManager for actual pooling. This class exists for backward compatibility and convenience.

public sealed class OpenCLStreamPool : IAsyncDisposable
Inheritance
OpenCLStreamPool
Implements
Inherited Members

Methods

AcquireAsync(QueueProperties, CancellationToken)

Acquires a command queue from the pool with specified properties. This is a convenience wrapper around the stream manager's acquire method.

public ValueTask<QueueHandle> AcquireAsync(QueueProperties properties, CancellationToken cancellationToken = default)

Parameters

properties QueueProperties

Queue properties specifying execution mode and profiling.

cancellationToken CancellationToken

Cancellation token for async operations.

Returns

ValueTask<QueueHandle>

A handle to the acquired command queue with automatic cleanup.

Exceptions

ObjectDisposedException

Thrown if the pool has been disposed.

AcquireAsync(CancellationToken)

Acquires a command queue from the pool with default in-order execution properties. Provides a simplified interface for common use cases.

public ValueTask<QueueHandle> AcquireAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token for async operations.

Returns

ValueTask<QueueHandle>

A handle to the acquired command queue with automatic cleanup.

Exceptions

ObjectDisposedException

Thrown if the pool has been disposed.

DisposeAsync()

Asynchronously disposes the pool, delegating cleanup to the stream manager.

public ValueTask DisposeAsync()

Returns

ValueTask

GetStatistics()

Gets pool usage statistics for monitoring and optimization.

public QueueStatistics GetStatistics()

Returns

QueueStatistics

Current statistics snapshot.

Exceptions

ObjectDisposedException

Thrown if the pool has been disposed.