package arrayjit

  1. Overview
  2. Docs
type context
type code
val sexp_of_code : code -> Sexplib0.Sexp.t
type code_batch
val sexp_of_code_batch : code_batch -> Sexplib0.Sexp.t
type ctx_array
val initialize : Backend_utils.Types.config -> Base.unit
val is_initialized : Base.unit -> Base.bool
val finalize : context -> Base.unit
val sexp_of_context : context -> Sexplib.Sexp.t
val compile : name:Base.string -> Indexing.unit_bindings -> Low_level.optimized -> code
val compile_batch : names:Base.string Base.option Base.array -> Indexing.unit_bindings -> Low_level.optimized Base.option Base.array -> code_batch
val is_in_context : Low_level.traced_array -> Base.bool
val ctx_arrays : context -> ctx_array Base.Map.M(Arrayjit.Tnode).t
val unsafe_cleanup : Base.unit -> Base.unit
val from_host : context -> Tnode.t -> Base.bool

If the array is both hosted and in-context, copies from host to context.

val to_host : context -> Tnode.t -> Base.bool

If the array is both hosted and in-context, copies from context to host.

val device_to_device : Tnode.t -> into_merge_buffer:Backend_utils.Types.merge_buffer_use -> dst:context -> src:context -> Base.bool

If the array is in both contexts, copies from dst to src.

type buffer_ptr
val sexp_of_buffer_ptr : buffer_ptr -> Sexplib0.Sexp.t
val to_buffer : Tnode.t -> dst:buffer_ptr -> src:context -> Base.unit
val host_to_buffer : Ndarray.t -> dst:buffer_ptr -> Base.unit
val buffer_to_host : Ndarray.t -> src:buffer_ptr -> Base.unit
val get_buffer : Tnode.t -> context -> buffer_ptr Base.option
type physical_device
type device
val alloc_buffer : ?old_buffer:(buffer_ptr * Base.int) -> size_in_bytes:Base.int -> device -> buffer_ptr
val init : device -> context
val await : device -> Base.unit
val is_idle : device -> Base.bool
val sexp_of_device : device -> Sexplib.Sexp.t
val num_physical_devices : Base.unit -> Base.int
val suggested_num_virtual_devices : physical_device -> Base.int
val get_device : ordinal:Base.int -> physical_device
val get_physical_device : device -> physical_device
val new_virtual_device : physical_device -> device
val get_ctx_device : context -> device
val get_name : device -> Base.string
val to_ordinal : physical_device -> Base.int
val to_subordinal : device -> Base.int
OCaml

Innovation. Community. Security.