Module Realize.Buffers
Maps buffer UOps to concrete device buffers.
A Tolk_uop.Ops.t.Buffer node is backed by a fresh allocation the first time it is resolved — on the node's own device placement, resolved through the device registry (Device.get), with one allocation per device for multi-device placements — then cached by node identity; seeding a node with seed overrides that allocation.
create ~device is an empty binding allocating on device the nodes that carry no device placement of their own.
val seed : t -> Tolk_uop.Uop.t -> Device.Buffer.t -> unitseed t node buf binds node to buf, overriding lazy allocation.
val seed_multi : t -> Tolk_uop.Uop.t -> Device.Multi_buffer.t -> unitseed_multi t node mbuf binds node to the multi-device buffer mbuf, overriding lazy allocation.
val remove : t -> Tolk_uop.Uop.t -> unitremove t node drops node's binding, if any.
val mem : t -> Tolk_uop.Uop.t -> boolmem t node is true iff node is bound.
val find_buffer : t -> Tolk_uop.Uop.t -> buffer optionfind_buffer t node is the buffer bound to node, if any.
val find_opt : t -> Tolk_uop.Uop.t -> Device.Buffer.t optionfind_opt t node is the single-device buffer bound to node, if any.
Raises Invalid_argument if node is bound to a multi-device buffer.
val buffer_of_node : t -> Tolk_uop.Uop.t -> bufferbuffer_of_node t node is the buffer backing the Tolk_uop.Ops.t.Buffer node, allocating and caching it on first use.
val of_buffer_node : t -> Tolk_uop.Uop.t -> Device.Buffer.tof_buffer_node t node is buffer_of_node for a node backed by a single-device buffer.
Raises Invalid_argument if node is backed by a multi-device buffer.
val clear : t -> unitclear t drops all bindings.