Backend_intf.Device
include Device_types
include Device_config
include Device_config_common
val sexp_of_dev : dev -> Sexplib0.Sexp.t
val sexp_of_runner : runner -> Sexplib0.Sexp.t
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
The optimization context for compiling code, in particular Low_level.optimize_ctx
for low-level backends.
val sexp_of_optimize_ctx : optimize_ctx -> Sexplib0.Sexp.t
val empty_optimize_ctx : Base.unit -> optimize_ctx
type nonrec device = (buffer_ptr, dev, runner, event) device
val sexp_of_device : device -> Sexplib0.Sexp.t
type nonrec stream = (buffer_ptr, dev, runner, event) stream
val sexp_of_stream : stream -> Sexplib0.Sexp.t
type nonrec context = (buffer_ptr, stream, optimize_ctx) context
val sexp_of_context : context -> Sexplib0.Sexp.t
include Alloc_buffer
with type buffer_ptr := buffer_ptr
and type stream := stream
include Buffer with type buffer_ptr := buffer_ptr
val sexp_of_buffer_ptr : buffer_ptr -> Sexplib0.Sexp.t
include sig ... end
type nonrec buffer = buffer_ptr buffer
val sexp_of_buffer : buffer -> Sexplib0.Sexp.t
type nonrec ctx_arrays = buffer_ptr ctx_arrays
val sexp_of_ctx_arrays : ctx_arrays -> Sexplib0.Sexp.t
val alloc_array : Ops.prec -> dims:Base.int Base.array -> stream -> buffer_ptr
val alloc_zeros : Ops.prec -> dims:Base.int Base.array -> stream -> buffer_ptr
val free_buffer : (stream -> buffer_ptr -> Base.unit) Base.option
val make_context :
?ctx_arrays:ctx_arrays ->
?optimize_ctx:optimize_ctx ->
stream ->
context
Returns a context without a parent.
val make_child :
?ctx_arrays:ctx_arrays ->
?optimize_ctx:optimize_ctx ->
context ->
context
Returns a context with the same Backend_intf.context.stream
, and Backend_intf.context.ctx_arrays
, Backend_intf.context.optimize_ctx
if omitted, as the given context's, which is also the Backend_intf.context.parent
.
val get_name : stream -> Base.string