Module Ir.Backend_impl

The components for use in backend implementations

Implementation-facing types and components.

module Lazy = Utils.Lazy
val _get_local_debug_runtime : unit -> (module Minidebug_runtime.Debug_runtime)
type 'buffer_ptr buffer = {
  1. ptr : 'buffer_ptr;
  2. size_in_bytes : Base.int;
}
val sexp_of_buffer : 'buffer_ptr. ('buffer_ptr -> Sexplib0.Sexp.t) -> 'buffer_ptr buffer -> Sexplib0.Sexp.t
module Buffer_types (Buffer_ptr : sig ... end) : sig ... end
module type Buffer = sig ... end
module type No_device_buffer_and_copying = sig ... end
module No_device_buffer_and_copying () : No_device_buffer_and_copying with type buffer_ptr = Base.unit Ctypes.ptr
module type Device_slab = sig ... end

The device-level slab interface a Device functor consumes: the Backend_intf.Slab_alloc primitives plus the resolve_pool address resolution.

Backs the device-level slab interface with a backend's raw byte-buffer primitives and a private (device_id, pool_id) -> 'base table. Replaces the old Alloc_buffer_ignore_stream.

val next_global_device_id : Utils.atomic_int
module type Backend_impl_common = sig ... end

Parts shared by backend implementations.

module type For_add_scheduler = sig ... end

An interface to adding schedulers for stream-agnostic (typically CPU) backend implementations.

module type Lowered_no_device_backend = sig ... end

Lowered-level stream agnostic backend interface: implementation-facing API for CPU backends.

module type No_buffer_retrieval_or_syncing = sig ... end

The transfer/sync seam the shared Backends layer consumes. It speaks Backend_intf.buffer_loc only -- the concrete backend pointer never crosses this boundary; each backend resolves buffer_loc -> base internally.

module type With_scheduler = sig ... end

An intermediate stage for converting Lowered_no_device_backend backends into Lowered_backend. It could potentially be used for assignments-level backends too. This impl-facing stage may carry the backend-private resolve_pool (its base type does not escape to Backend_intf).

module type Lowered_backend = sig ... end

Lowered-level backend interface: implementation-facing API for device-based (GPU, or CPU after adding a scheduler) backends based on the Low_level IR.