Multicore.Backend
include Backend_intf.Backend_any_common
val initialize : Backend_intf.config -> Base.unit
Initializes a backend before first use. Typically does nothing if the backend is already initialized, but some backends can do some safe cleanups.
Returns false if there was no previous initialize
call. If it returns false, one must call initialize
before using the backend.
include Backend_impl.No_device_buffer_and_copying
with type buffer_ptr := buffer_ptr
include Backend_intf.Alloc_buffer
with type stream := Base.unit
with type buffer_ptr := buffer_ptr
include Backend_intf.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 Backend_intf.buffer
val sexp_of_buffer : buffer -> Sexplib0.Sexp.t
type nonrec ctx_arrays = buffer_ptr Backend_intf.ctx_arrays
val sexp_of_ctx_arrays : ctx_arrays -> Sexplib0.Sexp.t
val alloc_zero_init_array :
Ops.prec ->
dims:Base.int Base.array ->
Base.unit ->
buffer_ptr
val free_buffer : (Base.unit -> buffer_ptr -> Base.unit) Base.option
val use_host_memory : (Base.unit Ctypes.ptr -> buffer_ptr) Base.option
Returns (an upper bound of) the memory used for arrays, in bytes.
val buffer_to_buffer :
dst:buffer_ptr ->
src:buffer_ptr ->
size_in_bytes:Base.int ->
Base.unit
val host_to_buffer : Ndarray.t -> dst:buffer_ptr -> Base.unit
val buffer_to_host : Ndarray.t -> src:buffer_ptr -> Base.unit