Schedulers.SyncA minimalisitc wrapper creating backends where all calls run synchronously on the main thread. There is only one device, but an arbitrary number of streams.
module Backend : Ir.Backend_impl.For_add_schedulerinclude module type of struct include Backend endinclude Ir.Backend_impl.No_device_buffer_and_copyinginclude Ir.Backend_impl.Bufferval sexp_of_buffer_ptr : Backend.buffer_ptr -> Sexplib0.Sexp.tinclude sig ... endtype nonrec buffer = Backend.buffer_ptr Ir.Backend_impl.bufferval sexp_of_buffer : buffer -> Sexplib0.Sexp.tRaw slab primitives used by Make_slab to back the device-level Backend_intf.Slab_alloc. They allocate / free / zero contiguous backend buffers by byte size; pool-id bookkeeping lives in the shared slab wrapper.
val alloc_pool_raw : size_in_bytes:Base.int -> Backend.buffer_ptrval free_pool_raw : (Backend.buffer_ptr -> Base.unit) Base.optionval memset_zero_raw :
Backend.buffer_ptr ->
offset:Base.int ->
size_in_bytes:Base.int ->
Base.unitval offset_buffer : Backend.buffer_ptr -> bytes:Base.int -> Backend.buffer_ptrReturns a handle for the slab pointer advanced by bytes. Used by Make_slab.resolve_pool to turn a { pool_id; offset } into the concrete pointer for a sub-region of a multi-tenant pool. For bytes = 0 this must return the base unchanged.
val buffer_to_buffer :
dst:Backend.buffer_ptr ->
src:Backend.buffer_ptr ->
size_in_bytes:Base.int ->
Base.unitval host_to_buffer : Ir.Ndarray.t -> dst:Backend.buffer_ptr -> Base.unitval buffer_to_host : Ir.Ndarray.t -> src:Backend.buffer_ptr -> Base.unitmodule Device_config : sig ... endmodule Device_types : sig ... endinclude sig ... endtype dev = Device_types.devval sexp_of_dev : dev -> Sexplib0.Sexp.ttype runner = Device_types.runnerval sexp_of_runner : runner -> Sexplib0.Sexp.ttype event = Device_types.eventval sexp_of_event : event -> Sexplib0.Sexp.ttype optimize_ctx = Device_types.optimize_ctxval sexp_of_optimize_ctx : optimize_ctx -> Sexplib0.Sexp.tval empty_optimize_ctx : Base.unit -> optimize_ctxval sexp_of_device : device -> Sexplib0.Sexp.tval sexp_of_context : context -> Sexplib0.Sexp.tval alloc_pool :
?mode:Ir.Tnode.memory_mode ->
Device_types.device ->
pool_id:Base.int ->
size_in_bytes:Base.int ->
alignment:Base.int ->
Base.unitval free_pool :
(Device_types.device -> pool_id:Base.int -> Base.unit) Base.optionval memset_zero :
Device_types.device ->
pool_id:Base.int ->
offset:Base.int ->
size_in_bytes:Base.int ->
Base.unittype buffer_ptr = Ir.Backend_impl.Make_slab(Device_types)(Backend).buffer_ptrval resolve_pool :
Device_types.device ->
Ir.Backend_intf.buffer_loc ->
buffer_ptrval make_device :
'a ->
'b ->
ordinal:Base.int ->
('a, 'b, 'c) Ir.Backend_intf.deviceval get_name : ('a, 'b, 'c) Ir.Backend_intf.device -> stringval make_context :
?ctx_buffers:
(Ir.Tnode.t, Ir.Backend_intf.buffer_loc, Ir.Tnode.comparator_witness)
Base.Map.t ->
?optimize_ctx:optimize_ctx ->
('a, 'b, 'c) Ir.Backend_intf.device ->
('a, 'b, 'c, optimize_ctx) Ir.Backend_intf.contextval make_child :
?ctx_buffers:Ir.Backend_intf.ctx_buffers ->
?optimize_ctx:'a ->
?merge_buffer_node:Ir.Tnode.t Base.option ->
('b, 'c, 'd, 'a) Ir.Backend_intf.context ->
('b, 'c, 'd, 'a) Ir.Backend_intf.contextval device : deviceval get_device : ordinal:Base.Int.t -> deviceval schedule_task : 'a -> Ir.Task.t -> Base.unitval get_debug_info : device -> Sexplib0.Sexp.t