Module type Backend_intf.Device

include Device_types
include Device_config
include Device_config_common
type dev

Interface to a device driver.

val sexp_of_dev : dev -> Sexplib0.Sexp.t
type runner

Interface to a stream driver.

val sexp_of_runner : runner -> Sexplib0.Sexp.t
type event

An event tracks if a device's runner finished computing past a particular point in its schedule. These values are used internally for scheduling across devices/queues of the backend, and can be used for explicit scheduling.

val sexp_of_event : event -> Sexplib0.Sexp.t
val name : Base.string
type optimize_ctx

The optimization context for compiling code, in particular Low_level.optimize_ctx for low-level backends.

val sexp_of_optimize_ctx : optimize_ctx -> Sexplib0.Sexp.t
val empty_optimize_ctx : Base.unit -> optimize_ctx
type nonrec device = (dev, runner, event) device
val sexp_of_device : device -> Sexplib0.Sexp.t
type nonrec context = (dev, runner, event, optimize_ctx) context
val sexp_of_context : context -> Sexplib0.Sexp.t
include Slab_alloc with type device := device
val alloc_pool : ?mode:Tnode.memory_mode -> device -> pool_id:Base.int -> size_in_bytes:Base.int -> alignment:Base.int -> Base.unit

Allocates the slab for pool_id on device. The optional ?mode carries the tnode's memory mode so backends can pick a storage mode (Metal private vs. shared); backends that do not care ignore it.

val free_pool : (device -> pool_id:Base.int -> Base.unit) Base.option

Frees the slab for pool_id and drops its table entry. None for backends that rely on GC.

val memset_zero : device -> pool_id:Base.int -> offset:Base.int -> size_in_bytes:Base.int -> Base.unit

Zero-initializes size_in_bytes at base_of pool_id + offset.

val make_device : dev -> runner -> ordinal:Base.int -> device
val make_context : ?ctx_buffers:ctx_buffers -> ?optimize_ctx:optimize_ctx -> device -> context

Returns a context without a parent.

val make_child : ?ctx_buffers:ctx_buffers -> ?optimize_ctx:optimize_ctx -> ?merge_buffer_node:Tnode.t Base.option -> context -> context
val get_name : device -> Base.string