Table of Contents

Struct EventHandle

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

RAII handle for managed events with automatic cleanup. Ensures events are properly returned to the pool or destroyed when no longer needed.

public readonly struct EventHandle : IAsyncDisposable, IEquatable<EventHandle>
Implements
Inherited Members

Properties

Event

Gets the underlying OpenCL event handle.

public OpenCLEventHandle Event { get; }

Property Value

OpenCLEventHandle

Methods

DisposeAsync()

Asynchronously releases the event back to the manager's pool.

public ValueTask DisposeAsync()

Returns

ValueTask

Equals(EventHandle)

Determines whether the specified handle is equal to the current handle.

public bool Equals(EventHandle other)

Parameters

other EventHandle

Returns

bool

Equals(object?)

Determines whether the specified object is equal to the current handle.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Returns the hash code for this handle.

public override int GetHashCode()

Returns

int

GetProfilingInfoAsync()

Gets profiling information for this event (if profiling was enabled). Returns null if profiling is not available.

public ValueTask<EventProfilingInfo?> GetProfilingInfoAsync()

Returns

ValueTask<EventProfilingInfo>

WaitAsync(CancellationToken)

Waits for the event to complete.

public ValueTask WaitAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask

Operators

operator ==(EventHandle, EventHandle)

Determines whether two handles are equal.

public static bool operator ==(EventHandle left, EventHandle right)

Parameters

left EventHandle
right EventHandle

Returns

bool

operator !=(EventHandle, EventHandle)

Determines whether two handles are not equal.

public static bool operator !=(EventHandle left, EventHandle right)

Parameters

left EventHandle
right EventHandle

Returns

bool