package arrayjit

  1. Overview
  2. Docs
type code
type context = Gccjit_backend.context
type nonrec routine = context routine
val name : Base.string
val initialize : Base.unit -> Base.unit
val is_initialized : Base.unit -> Base.bool
val init : label:Base.string -> context

label is usually the backend name concatenated with the device number.

val finalize : context -> Base.unit

Finalizes (just) the context.

val sexp_of_code : code -> Base.Sexp.t
val sexp_of_context : context -> Base.Sexp.t
val sexp_of_routine : routine -> Base.Sexp.t
val maybe_jit : shared:Base.bool -> ?name:Base.string -> Indexing.unit_bindings -> Assignments.t -> code
val maybe_jit_batch : shared:Base.bool -> ?names:Base.string Base.array -> Indexing.unit_bindings -> Assignments.t Base.array -> code Base.array

Unlike the ~shared parameter, maybe_jit_batch vs. maybe_jit is purely about improving the compile time (does not affect execution).

val jit_code : context -> code -> routine
val jit : context -> ?name:Base.string -> Indexing.unit_bindings -> Assignments.t -> routine
val unsafe_cleanup : ?unsafe_shutdown:Base.bool -> Base.unit -> Base.unit

Cleans up all work on a backend. If ~unsafe_shutdown:true, releases resources, potentially making the backend unusable.

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

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

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

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

val merge : ?name_prefix:Base.string -> Tnode.t -> accum:Ops.binop -> src:context -> code Base.option

Merges the array from the source context into the destination context: dst =: dst accum src. If the array is hosted, its state on host is undefined after this operation. (A backend may choose to use the host array as a buffer, if that is beneficial.) name_prefix is prepended to the jitted function's name. Returns None if the array is not in the context.

val merge_batch : ?name_prefixes:Base.string Base.array -> occupancy:(Tnode.t -> src_n:Base.int -> src:context -> Utils.requirement) -> Tnode.t Base.list -> accum:Ops.binop -> srcs:context Base.array -> (Tnode.t, code Base.option Base.array) Base.Hashtbl.t

merge_batch vs. merge is purely about improving the compile time (does not affect execution).

OCaml

Innovation. Community. Security.