Module Backend_impl.Device

Parameters

Signature

include module type of struct include Device_types end
include Backend_intf.Device_config
include Backend_intf.Buffer
type buffer_ptr = Device_types.buffer_ptr
include sig ... end
type dev = Device_types.dev

Interface to a device driver.

val sexp_of_dev : dev -> Sexplib0.Sexp.t
type runner = Device_types.runner

Interface to a stream driver.

val sexp_of_runner : runner -> Sexplib0.Sexp.t
type event = Device_types.event

An event tracks if a stream finished computing past a particular point in its schedue. These values are used internally for scheduling across streams of the backend, and can be used for explicit scheduling.

val sexp_of_event : event -> Sexplib0.Sexp.t
val name : Base.string
type nonrec device = (buffer_ptr, dev, runner, event) Backend_intf.device
val sexp_of_device : device -> Sexplib0.Sexp.t
type nonrec stream = (buffer_ptr, dev, runner, event) Backend_intf.stream
val sexp_of_stream : stream -> Sexplib0.Sexp.t
type nonrec context = (buffer_ptr, stream) Backend_intf.context
val sexp_of_context : context -> Sexplib0.Sexp.t
include module type of struct include Alloc_buffer end
include Backend_intf.Buffer with type buffer_ptr := Device_types.buffer_ptr
val sexp_of_buffer_ptr : Device_types.buffer_ptr -> Sexplib0.Sexp.t
include sig ... end
val sexp_of_buffer : buffer -> Sexplib0.Sexp.t
val sexp_of_ctx_arrays : ctx_arrays -> Sexplib0.Sexp.t
val alloc_buffer : ?old_buffer:buffer -> size_in_bytes:Base.int -> Device_types.stream -> buffer
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