package arrayjit

  1. Overview
  2. Docs

Module Backends.Cuda_backendSource

include No_device_backend with type context = Cuda_backend.context
Sourcetype code
Sourcetype nonrec routine = context routine
Sourceval initialize : Base.unit -> Base.unit
Sourceval is_initialized : Base.unit -> Base.bool
Sourceval finalize : context -> Base.unit

Finalizes (just) the context.

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

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

Sourceval jit_code : context -> code -> routine
Sourceval 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.

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

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

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

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

Sourceval 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.

Sourceval 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).

Sourcetype device
Sourceval init : device -> context
Sourceval await : device -> Base.unit
Sourceval sexp_of_device : device -> Base.Sexp.t
Sourceval num_devices : Base.unit -> Base.int
Sourceval get_device : ordinal:Base.int -> device
Sourceval get_ctx_device : context -> device
Sourceval to_ordinal : device -> Base.int
Sourceval get_all_devices : Base.unit -> device Base.array
OCaml

Innovation. Community. Security.