Interface IMessageQueue
- Namespace
- DotCompute.Abstractions.RingKernels
- Assembly
- DotCompute.Abstractions.dll
Non-generic base interface for GPU-resident message queues (used for reflection).
public interface IMessageQueue : IAsyncDisposable
- Inherited Members
Remarks
This interface provides non-generic access to message queue properties and operations for scenarios requiring reflection or dynamic typing in ring kernel runtimes.
Properties
Capacity
Gets the queue capacity (maximum number of messages).
int Capacity { get; }
Property Value
Count
Gets the approximate current size of the queue.
int Count { get; }
Property Value
IsEmpty
Gets whether the queue is empty.
bool IsEmpty { get; }
Property Value
IsFull
Gets whether the queue is full.
bool IsFull { get; }
Property Value
Methods
ClearAsync(CancellationToken)
Clears all messages from the queue.
Task ClearAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the clear operation.
GetBuffer()
Gets the memory buffer handle for GPU access.
IUnifiedMemoryBuffer GetBuffer()
Returns
GetHeadPtr()
Gets the head pointer buffer (atomic counter for dequeue position).
IUnifiedMemoryBuffer GetHeadPtr()
Returns
GetStatisticsAsync()
Gets queue statistics for monitoring.
Task<MessageQueueStatistics> GetStatisticsAsync()
Returns
- Task<MessageQueueStatistics>
Queue statistics including message counts and throughput.
GetTailPtr()
Gets the tail pointer buffer (atomic counter for enqueue position).
IUnifiedMemoryBuffer GetTailPtr()
Returns
InitializeAsync(CancellationToken)
Initializes the message queue and allocates GPU buffers.
Task InitializeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the initialization operation.