Module Ir.Host_inits

A weakly-owned association from a tensor node to the host buffer holding its initialization data (ndarray-backed literals and persistence-loaded nodes). After gh-ocannl-333 the data is no longer stored on Tnode.t; instead it is registered here at construction and uploaded into a backend context, on demand, at link time.

The table is:

val register : Tnode.t -> Ndarray.t Stdlib.Lazy.t -> unit

Records the host initialization buffer for tn. A later registration for the same node overwrites the earlier one (the buffers describe the same node's data).

val find : Tnode.t -> Ndarray.t Stdlib.Lazy.t option

Returns the host initialization buffer for tn, if any, without removing it.

val mem : Tnode.t -> bool

Whether tn has registered host initialization data.