package arrayjit

  1. Overview
  2. Docs

Module Arrayjit.OpsSource

Operation types shared by all backends; and precision types.

Sourcemodule Lazy = Utils.Lazy

*** Precision ***

Sourcetype float16_elt = Bigarray.float32_elt
Sourcetype float32_elt = Bigarray.float32_elt
Sourcetype float64_elt = Bigarray.float64_elt
Sourcetype ('ocaml, 'impl) precision =
  1. | Byte : (Base.char, uint8_elt) precision
  2. | Half : (Base.float, float16_elt) precision
  3. | Single : (Base.float, float32_elt) precision
  4. | Double : (Base.float, float64_elt) precision
Sourceval sexp_of_precision : 'ocaml 'impl. ('ocaml -> Sexplib0.Sexp.t) -> ('impl -> Sexplib0.Sexp.t) -> ('ocaml, 'impl) precision -> Sexplib0.Sexp.t
Sourcetype prec =
  1. | Void_prec
  2. | Byte_prec of (Base.char, uint8_elt) precision
  3. | Half_prec of (Base.float, float16_elt) precision
  4. | Single_prec of (Base.float, float32_elt) precision
  5. | Double_prec of (Base.float, float64_elt) precision
Sourceval byte : prec
Sourceval half : prec
Sourceval single : prec
Sourceval double : prec
Sourceval sexp_of_prec : prec -> Base.Sexp.t
Sourceval prec_of_sexp : Base.Sexp.t -> prec
Sourceval precision_to_string : ('ocaml, 'elt_t) precision -> string
Sourceval prec_string : prec -> string
Sourceval equal_prec : prec -> prec -> bool
Sourceval prec_in_bytes : prec -> int
Sourceval promote_prec : prec -> prec -> prec
Sourceval pack_prec : ('ocaml, 'elt_t) precision -> prec
Sourcetype 'r map_prec = {
  1. f : 'ocaml 'elt_t. ('ocaml, 'elt_t) precision -> 'r;
}
Sourceval map_prec : ?default:'a -> 'a map_prec -> prec -> 'a
Sourceval cuda_typ_of_prec : prec -> string

*** Operations ***

Sourcetype init_op =
  1. | Constant_fill of {
    1. values : Base.float Base.array;
    2. strict : Base.bool;
    }
    (*

    Fills in the numbers where the rightmost axis is contiguous. If strict=true, loops over the provided values.

    *)
  2. | Range_over_offsets
    (*

    Fills in the offset number of each cell (i.e. how many cells away it is from the beginning).

    *)
  3. | Standard_uniform
    (*

    Draws the values from U(0,1).

    *)
  4. | File_mapped of Base.string * prec
    (*

    Reads the data using Unix.openfile and Unix.map_file.

    *)

Initializes or resets a array by filling in the corresponding numbers, at the appropriate precision.

Sourceval equal_init_op : init_op -> init_op -> Base.bool
Sourceval init_op_of_sexp : Sexplib0.Sexp.t -> init_op
Sourceval sexp_of_init_op : init_op -> Sexplib0.Sexp.t
Sourcetype binop =
  1. | Add
  2. | Sub
  3. | Mul
  4. | Div
  5. | ToPowOf
  6. | Relu_gate
  7. | Arg2
  8. | Arg1
Sourceval binop_of_sexp : Sexplib0.Sexp.t -> binop
Sourceval sexp_of_binop : binop -> Sexplib0.Sexp.t
Sourceval compare_binop : binop -> binop -> Base.int
Sourceval equal_binop : binop -> binop -> Base.bool
Sourcetype unop =
  1. | Identity
  2. | Relu
Sourceval unop_of_sexp : Sexplib0.Sexp.t -> unop
Sourceval sexp_of_unop : unop -> Sexplib0.Sexp.t
Sourceval compare_unop : unop -> unop -> Base.int
Sourceval equal_unop : unop -> unop -> Base.bool
Sourceval neutral_elem : binop -> float

Either the left-neutral or right-neutral element of the operation. Unspecified if the operation does not have a neutral element.

Sourceval interpret_binop : binop -> Base.Float.t -> Base.Float.t -> Base.Float.t
Sourceval interpret_unop : unop -> Base.Float.t -> Base.Float.t
Sourceval binop_C_syntax : prec -> binop -> string * string * string
Sourceval binop_cd_syntax : binop -> string
Sourceval assign_op_C_syntax : binop -> string
Sourceval assign_op_cd_syntax : initialize_neutral:bool -> binop -> string
Sourceval unop_cd_syntax : unop -> string

*** Global references ***

Sourceval sexp_of_voidptr : unit Ctypes_static.ptr -> Base.Sexp.t
Sourceval compare_voidptr : 'a Ctypes.ptr -> 'a Ctypes.ptr -> int
Sourceval equal_voidptr : voidptr -> voidptr -> Base.bool
Sourceval ptr_to_string : 'elem Ctypes.ptr -> prec -> Base.String.t
Sourcetype global_identifier =
  1. | C_function of Base.string
    (*

    Calls a no-argument or indices-arguments C function.

    *)
  2. | External_unsafe of {
    1. ptr : voidptr;
    2. prec : prec;
    3. dims : Base.int Base.array Lazy.t;
    }
  3. | Merge_buffer of {
    1. source_node_id : Base.int;
    }
    (*

    Each device has at most one merge buffer, which is re-used, and re-allocated as needed, by merge operations. The merge buffer is associated with the source node of the device's most recent device_to_device ~into_merge_buffer:true operation.

    *)
Sourceval sexp_of_global_identifier : global_identifier -> Sexplib0.Sexp.t
Sourceval equal_global_identifier : global_identifier -> global_identifier -> Base.bool
Sourceval compare_global_identifier : global_identifier -> global_identifier -> Base.int