package arrayjit

  1. Overview
  2. Docs

A minimalisitc wrapper creating backends where all calls run synchronously on the main thread. There is only one physical device, but as always an arbitrary number of virtual devices.

Parameters

Signature

type buffer_ptr = Backend.buffer_ptr
val sexp_of_buffer_ptr : buffer_ptr -> Sexplib0.Sexp.t
type device = {
  1. subordinal : Base.int;
  2. merge_buffer : (buffer_ptr * Tnode.t) Base.option Base.ref;
  3. mutable allocated_buffer : (buffer_ptr * Base.int) Base.option;
}
val sexp_of_device : device -> Sexplib0.Sexp.t
val alloc_buffer : ?old_buffer:(Backend.buffer_ptr * Base.int) -> size_in_bytes:Base.int -> 'a -> Backend.buffer_ptr
type physical_device =
  1. | CPU
val sexp_of_physical_device : physical_device -> Sexplib0.Sexp.t
type code = Backend.code
val sexp_of_code : code -> Sexplib0.Sexp.t
type code_batch = Backend.code_batch
val sexp_of_code_batch : code_batch -> Sexplib0.Sexp.t
val expected_merge_node : code -> Tnode.t Base.option
val expected_merge_nodes : code_batch -> Tnode.t Base.option Base.array
val is_idle : 'a -> bool
val name : Base.String.t
val await : 'a -> unit
val global_run_no : int Base.ref
type context = {
  1. device : device;
  2. ctx : Backend.context;
  3. expected_merge_node : Tnode.t Base.option;
}
val sexp_of_context : context -> Sexplib0.Sexp.t
type nonrec routine = context Backend_utils.Types.routine
val sexp_of_routine : routine -> Sexplib0.Sexp.t
val init : device -> context
val initialize : Backend_utils.Types.config -> Base.unit
val is_initialized : Base.unit -> Base.bool
val finalize : context -> Base.unit
val compile : ?shared:Base.bool -> ?name:Base.string -> Indexing.unit_bindings -> Assignments.t -> Backend.code
val compile_batch : ?shared:Base.bool -> ?names:Base.string Base.array -> ?occupancy:(name:Base.string -> src_n:Base.int -> Base.bool) -> Indexing.unit_bindings -> Assignments.t Base.array -> Backend.code_batch
val get_name : device -> string
val from_host : context -> Tnode.t -> bool
val to_host : context -> Tnode.t -> bool
val device_to_device : Tnode.t -> into_merge_buffer:Backend_utils.Types.merge_buffer_use -> dst:context -> src:context -> bool
val num_physical_devices : unit -> int
val suggested_num_virtual_devices : 'a -> int
val next_virtual_device_id : int Base.ref
val unsafe_cleanup : unit -> Base.unit
val get_device : ordinal:int -> physical_device
val new_virtual_device : physical_device -> device
val get_physical_device : 'a -> physical_device
val get_ctx_device : context -> device
val to_ordinal : 'a -> int
val to_subordinal : device -> Base.int
val to_buffer : Tnode.t -> dst:Backend.buffer_ptr -> src:context -> Base.unit
val host_to_buffer : Ndarray.t -> dst:Backend.buffer_ptr -> Base.unit
val buffer_to_host : Ndarray.t -> src:Backend.buffer_ptr -> Base.unit
val get_buffer : Tnode.t -> context -> Backend.buffer_ptr Base.option
OCaml

Innovation. Community. Security.