Module Schedulers.Sync

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

Parameters

Signature

include module type of struct include Backend end
include Backend_intf.Backend_any_common
include Backend_intf.Buffer
include sig ... end
include Backend_impl.No_device_buffer_and_copying with type buffer_ptr := Backend.buffer_ptr
include Backend_intf.Alloc_buffer with type stream := Base.unit with type buffer_ptr := Backend.buffer_ptr
include Backend_intf.Buffer with type buffer_ptr := Backend.buffer_ptr
include sig ... end
val use_host_memory : (Base.unit Ctypes.ptr -> Backend.buffer_ptr) Base.option
val buffer_to_buffer : dst:Backend.buffer_ptr -> src:Backend.buffer_ptr -> size_in_bytes:Base.int -> 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
module Device_config : sig ... end
module Device_types : sig ... end
include sig ... end
type buffer_ptr = Device_types.buffer_ptr
type dev = Device_types.dev
val sexp_of_dev : dev -> Sexplib0.Sexp.t
type runner = Device_types.runner
val sexp_of_runner : runner -> Sexplib0.Sexp.t
type event = Device_types.event
val sexp_of_event : event -> Sexplib0.Sexp.t
val name : Base.string
type nonrec device
val sexp_of_device : device -> Sexplib0.Sexp.t
type nonrec stream
val sexp_of_stream : stream -> Sexplib0.Sexp.t
type nonrec context
val sexp_of_context : context -> Sexplib0.Sexp.t
val sexp_of_buffer_ptr : Device_types.buffer_ptr -> Sexplib0.Sexp.t
type nonrec buffer
val sexp_of_buffer : buffer -> Sexplib0.Sexp.t
type nonrec ctx_arrays = Device_types.buffer_ptr Base.Map.M(Arrayjit.Tnode).t
val sexp_of_ctx_arrays : ctx_arrays -> Sexplib0.Sexp.t
val alloc_zero_init_array : Ops.prec -> dims:Base.int Base.array -> Device_types.stream -> Device_types.buffer_ptr
val free_buffer : (Device_types.stream -> Device_types.buffer_ptr -> Base.unit) Base.option
val make_device : 'a -> ordinal:Base.int -> ('b, 'a, 'c, 'd) Backend_intf.device
val make_stream : ('a, 'b, 'c, 'd) Backend_intf.device -> 'c -> ('a, 'b, 'c, 'd) Backend_intf.stream_ref
val get_name : ('a, 'b, 'c, 'd) Backend_intf.stream -> string
val make_context : ?ctx_arrays:(Tnode.t, 'a, Tnode.comparator_witness) Base.Map.t -> 'b -> ('a, 'b) Backend_intf.context
val make_child : ?ctx_arrays:'a Backend_intf.ctx_arrays -> ('a, 'b) Backend_intf.context -> ('a, 'b) Backend_intf.context
val sync : unit -> unit
val is_done : unit -> bool
val will_wait_for : 'a -> unit -> unit
val alloc_buffer : ?old_buffer:Backend.buffer -> size_in_bytes:Base.int -> 'a -> Backend.buffer
val device : device
val get_device : ordinal:Base.Int.t -> device
val num_devices : unit -> int
val suggested_num_streams : 'a -> int
val get_used_memory : 'a -> Base.int
val new_stream : ('a, 'b, unit, 'c) Backend_intf.device -> ('a, 'b, unit, 'c) Backend_intf.stream_ref
val all_work : 'a -> unit
val is_idle : 'a -> bool
val await : 'a -> unit
val initialize : Arrayjit__Backend_intf.config -> Base.unit
val is_initialized : Base.unit -> Base.bool
val schedule_task : 'a -> Task.t -> Base.unit
val get_global_debug_info : unit -> Sexplib0.Sexp.t
val get_debug_info : stream -> Sexplib0.Sexp.t