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 endval config : Ir.Backend_intf.configinclude Ir.Backend_impl.No_device_buffer_and_copyinginclude Ir.Backend_intf.Alloc_buffer with type stream := Base.unitinclude Ir.Backend_intf.Bufferinclude sig ... endval use_host_memory :
(size_in_bytes:Base.int ->
Base.unit Ctypes.ptr ->
Backend.buffer_ptr)
Base.optionval 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 buffer_ptr = Device_types.buffer_ptrtype 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_stream : stream -> Sexplib0.Sexp.tval sexp_of_context : context -> Sexplib0.Sexp.tval sexp_of_buffer_ptr : Device_types.buffer_ptr -> Sexplib0.Sexp.tval sexp_of_buffer : buffer -> Sexplib0.Sexp.ttype nonrec ctx_arrays = Device_types.buffer_ptr Base.Map.M(Ir.Tnode).tval sexp_of_ctx_arrays : ctx_arrays -> Sexplib0.Sexp.tval alloc_array :
Ir.Ops.prec ->
dims:Base.int Base.array ->
Device_types.stream ->
Device_types.buffer_ptrval alloc_zeros :
Ir.Ops.prec ->
dims:Base.int Base.array ->
Device_types.stream ->
Device_types.buffer_ptrval free_buffer :
(Device_types.stream -> Device_types.buffer_ptr -> Base.unit) Base.optionval make_device :
'a ->
ordinal:Base.int ->
('b, 'a, 'c, 'd) Ir.Backend_intf.deviceval make_stream :
('a, 'b, 'c, 'd) Ir.Backend_intf.device ->
'c ->
('a, 'b, 'c, 'd) Ir.Backend_intf.stream_refval get_name : ('a, 'b, 'c, 'd) Ir.Backend_intf.stream -> stringval make_context :
?ctx_arrays:(Ir.Tnode.t, 'a, Ir.Tnode.comparator_witness) Base.Map.t ->
?optimize_ctx:optimize_ctx ->
'b ->
('a, 'b, optimize_ctx) Ir.Backend_intf.contextval make_child :
?ctx_arrays:'a Ir.Backend_intf.ctx_arrays ->
?optimize_ctx:'b ->
('a, 'c, 'b) Ir.Backend_intf.context ->
('a, 'c, 'b) Ir.Backend_intf.contextval alloc_buffer :
?old_buffer:Backend.buffer ->
size_in_bytes:Base.int ->
'a ->
Backend.bufferval device : deviceval get_device : ordinal:Base.Int.t -> deviceval new_stream :
('a, 'b, unit, 'c) Ir.Backend_intf.device ->
('a, 'b, unit, 'c) Ir.Backend_intf.stream_refval schedule_task : 'a -> Ir.Task.t -> Base.unitval get_debug_info : stream -> Sexplib0.Sexp.t