Cudajit.Delimited_event
This module builds on top of functionality more directly exposed by Event
. It optimizes resource management for use-cases where events are not reused: there's only one call to Event.record
, and it's immediately after Event.create
.
An delimited event encapsulates Event.t
and is owned by a stream. It records its owner at creation, and gets released (using cuEventDestroy) when either it or its owner are synchronized (or if neither happens, when it is garbage-collected).
val sexp_of_t : t -> Sexplib0.Sexp.t
Combines Event.create
and Event.record
to create an event owned by the given stream.
val is_released : t -> bool
Returns true if the delimited event is already released using cuEventDestroy. The event will be released by synchronize
and Stream.synchronize
.
val query : t -> bool
See Event.query
. query event
returns true
when event
is already released.
val synchronize : t -> unit
See Event.synchronize
. synchronize event
is a no-op if event
is already released.
See Event.wait
. wait stream event
is a no-op if event
is already released.