Module Backend.Async

Ranged / stream-ordered transfers, pinned host memory and inter-stream ordering (see ASYNC). Backends that do not provide them use Async_refused.

val host_to_device : src_ptr:nativeint -> dst:'a Memory.buffer -> dst_offset:int -> byte_size:int -> stream:Stream.t option -> unit
val device_to_host : src:'a Memory.buffer -> src_offset:int -> dst_ptr:nativeint -> byte_size:int -> stream:Stream.t option -> unit
val stream_wait_event : Stream.t -> Event.t -> unit

All work enqueued on the stream after this call waits until the work recorded by the event has completed.

val event_query : Event.t -> bool

true once the work recorded by the event has completed (or the event was never recorded); never blocks.

val alloc_pinned : Device.t -> byte_size:int -> nativeint

Page-locked host memory of byte_size bytes, returned as a raw address. Released by free_pinned. A backend whose pinned memory belongs to the device (Vulkan: a driver mapping) unmaps it when the device is destroyed; the address is then invalid and only free_pinned may still be called on it.

val free_pinned : Device.t -> nativeint -> unit
val register_host : Device.t -> nativeint -> byte_size:int -> unit

Page-lock existing host memory for DMA. The caller keeps it alive until unregister_host.

val unregister_host : Device.t -> nativeint -> unit