package arrayjit

  1. Overview
  2. Docs

Module UtilsSource

Sourcemodule Set_O : sig ... end
Sourceval map_merge : ('a, 'b, 'c) Base.Map.t -> ('a, 'b, 'c) Base.Map.t -> f:('b -> 'b -> 'b) -> ('a, 'b, 'c) Base.Map.t
Sourceval mref_add : ('a, 'b, 'c) Base.Map.t Base.ref -> key:'a -> data:'b -> or_:('b -> Base.unit) -> Base.unit
Sourceval mref_add_missing : ('a, 'b, 'c) Base.Map.t Base.ref -> 'a -> f:(unit -> 'b) -> Base.unit
Sourcetype settings = {
  1. mutable log_level : Base.int;
  2. mutable debug_log_from_routines : Base.bool;
    (*

    If the debug_log_from_routines flag is true _and_ the flag log_level > 1, backends should generate code (e.g. fprintf statements) to log the execution, and arrange for the logs to be emitted via ppx_minidebug.

    *)
  3. mutable output_debug_files_in_build_directory : Base.bool;
    (*

    Writes compilation related files in the build_files subdirectory of the run directory (additional files, or files that would otherwise be in temp directory). When both output_debug_files_in_build_directory = true and log_level > 1, compilation should also preserve debug and line information for runtime debugging.

    *)
  4. mutable fixed_state_for_init : Base.int Base.option;
  5. mutable print_decimals_precision : Base.int;
    (*

    When rendering arrays etc., outputs this many decimal digits.

    *)
  6. mutable check_half_prec_constants_cutoff : Base.float Base.option;
    (*

    If given, generic code optimization should fail if a half precision FP16 constant exceeds the cutoff.

    *)
  7. mutable automatic_host_transfers : Base.bool;
    (*

    If true, from_host and to_host happen automatically in specific situations.

    • When a host array is about to be read, we transfer to host from the context that most recently updated the node.
    • When a routine is about to be run, we transfer the routine's inputs from host to the routine's context if the host array was not yet transfered since its creation or most recent modification.
    *)
}
Sourceval settings_of_sexp : Sexplib0.Sexp.t -> settings
Sourceval sexp_of_settings : settings -> Sexplib0.Sexp.t
Sourceval settings : settings
Sourceval accessed_global_args : Base.String.t Base.Hash_set.t
Sourceval str_nonempty : f:(Base.String.t -> 'a) -> Base.String.t -> 'a option
Sourceval pair : 'a -> 'b -> 'a * 'b
Sourceval read_cmdline_or_env_var : Base.string -> Base.String.t option
Sourceval filename_parts : string -> string list
Sourceval filename_of_parts : string list -> string
Sourceval get_global_arg : default:Base.String.t -> arg_name:Base.string -> Base.String.t

Retrieves arg_name argument from the command line or from an environment variable, returns default if none found.

Sourceval get_global_flag : default:bool -> arg_name:Base.string -> bool
Sourceval original_log_level : Base.Int.t
Sourceval filename_concat : Base.String.t -> Base.String.t -> Base.String.t
Sourceval clean_filename : Base.String.t -> Base.String.t
Sourceval diagn_log_file : Base.String.t -> Base.String.t
Sourceval get_local_debug_runtime : unit -> (module Minidebug_runtime.Debug_runtime)
Sourceval _get_local_debug_runtime : unit -> (module Minidebug_runtime.Debug_runtime)
Sourceval set_log_level : Base.int -> unit
Sourceval restore_settings : unit -> unit
Sourceval with_runtime_debug : unit -> Base.bool
Sourceval debug_log_from_routines : unit -> Base.bool
Sourceval never_capture_stdout : unit -> bool
Sourceval enable_runtime_debug : unit -> unit
Sourceval union_find : equal:('a -> 'a -> bool) -> ('a, 'a, 'b) Base.Map.t -> key:'a -> rank:int -> 'a * int
Sourceval union_add : equal:('a -> 'a -> bool) -> ('a, 'a, 'b) Base.Map.t -> 'a -> 'a -> ('a, 'a, 'b) Base.Map.t
Sourceval unique_keep_first : equal:('a -> 'a -> bool) -> 'a list -> 'a Base.List.t

Filters the list keeping the first occurrence of each element.

Sourceval sorted_diff : compare:('a -> 'b -> int) -> 'a Base.List.t -> 'b list -> 'a Base.List.t

Returns the multiset difference of l1 and l2, where l1 and l2 must be sorted in increasing order.

Sourceval remove_elem : equal:('a -> 'b -> bool) -> 'a -> 'b list -> 'b Base.List.t

Removes the first occurrence of an element from the list that is equal to the given element.

Sourceval parallel_merge : (from:int -> to_:int -> 'a) -> Base.int -> Base.unit

parallel_merge merge num_devices progressively invokes the pairwise merge callback, converging on the 0th position, with from ranging from 1 to num_devices - 1, and to_ < from.

Sourceval (!@) : 'a Atomic.t -> 'a
Sourcetype atomic_bool = Base.bool Atomic.t
Sourceval sexp_of_atomic_bool : Base.bool Atomic.t -> Sexplib0.Sexp.t
Sourcetype atomic_int = Base.int Atomic.t
Sourceval sexp_of_atomic_int : Base.int Atomic.t -> Sexplib0.Sexp.t
Sourceval sexp_append : elem:Base.Sexp.t -> Base.Sexp.t -> Base.Sexp.t
Sourceval sexp_mem : elem:Base.Sexp.t -> Base.Sexp.t -> bool
Sourceval sexp_deep_mem : elem:Base.Sexp.t -> Base.Sexp.t -> Base.bool
Sourceval split_with_seps : Re.re -> string -> string Base.List.t
Sourcemodule Lazy : sig ... end
Sourcetype requirement =
  1. | Skip
  2. | Required
  3. | Optional of {
    1. callback_if_missing : Base.unit -> Base.unit;
    }
Sourceval compare_requirement : requirement -> requirement -> Base.int
Sourceval requirement_of_sexp : Sexplib0.Sexp.t -> requirement
Sourceval sexp_of_requirement : requirement -> Sexplib0.Sexp.t
Sourceval default_indent : int Base.ref
Sourceval doc_of_sexp : Base.Sexp.t -> PPrint.document
Sourceval output_to_build_file : fname:Base.String.t -> (PPrint.ToChannel.document -> Base.unit) option
Sourceval get_debug_output_channel : fname:Base.String.t -> Stdio.Out_channel.t option
Sourceexception User_error of Base.string
Sourceval header_sep : Re.re
Sourceval log_trace_tree : 'a -> unit
Sourcetype 'a mutable_list =
  1. | Empty
  2. | Cons of {
    1. hd : 'a;
    2. mutable tl : 'a mutable_list;
    }
Sourceval equal_mutable_list : 'a. ('a -> 'a -> Base.bool) -> 'a mutable_list -> 'a mutable_list -> Base.bool
Sourceval mutable_list_of_sexp : 'a. (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a mutable_list
Sourceval sexp_of_mutable_list : 'a. ('a -> Sexplib0.Sexp.t) -> 'a mutable_list -> Sexplib0.Sexp.t
Sourceval empty : 'a mutable_list
Sourceval cons : hd:'a -> tl:'a mutable_list -> 'a mutable_list
Sourceval is_empty : 'a mutable_list -> bool
Sourceval is_cons : 'a mutable_list -> bool
Sourceval empty_val : 'a mutable_list -> unit Option.t
Sourceval cons_val : 'a mutable_list -> ([> `hd of 'a ] * [> `tl of 'a mutable_list ]) Option.t
Sourcemodule Variants_of_mutable_list : sig ... end
Sourceval insert : next:'a -> 'a mutable_list -> 'a mutable_list
Sourceval tl_exn : 'a mutable_list -> 'a mutable_list
Sourcetype build_file_channel = {
  1. f_path : Base.string;
  2. oc : out_channel;
  3. finalize : Base.unit -> Base.unit;
}
Sourceval open_build_file : base_name:Base.String.t -> extension:Base.String.t -> build_file_channel
Sourceval captured_log_prefix : string Base.ref
Sourcetype captured_log_processor = {
  1. log_processor_prefix : Base.string;
  2. process_logs : Base.string Base.list -> Base.unit;
}
Sourceval captured_log_processors : captured_log_processor Base.list Base.ref
Sourceval add_log_processor : prefix:Base.string -> (Base.string Base.list -> Base.unit) -> Base.unit
Sourceval input_scan_line : in_channel -> Base.int
Sourceval input_line : in_channel -> bool * Base.String.t
Sourceval capture_stdout_logs : (unit -> 'a) -> 'a
Sourceval log_debug_routine_logs : log_contents:Base.string Base.List.t -> stream_name:Base.String.t -> unit
Sourceval log_debug_routine_file : log_file_name:Base.string -> stream_name:Base.String.t -> unit
Sourcetype 'a weak_dynarray = 'a Weak.t Base.ref
Sourceval weak_create : unit -> 'a weak_dynarray
Sourceval sexp_of_weak_dynarray : ('a -> Sexplib0.Sexp.t) -> 'a Weak.t Base.ref -> Sexplib0.Sexp.t
Sourceval register_new : 'a weak_dynarray -> ?grow_by:int -> (int -> 'a) -> 'a
Sourceval weak_iter : 'a weak_dynarray -> f:('a -> unit) -> unit
Sourcetype 'a safe_lazy = {
  1. mutable value : [ `Callback of Base.unit -> 'a | `Value of 'a ];
  2. unique_id : Base.string;
}
Sourceval safe_lazy : Base.string -> (Base.unit -> 'a) -> 'a safe_lazy
Sourceval safe_force : 'a safe_lazy -> 'a
Sourceval is_safe_val : 'a safe_lazy -> bool
Sourceval safe_map : upd:Base.String.t -> f:('a -> 'b) -> 'a safe_lazy -> 'b safe_lazy
Sourceval equal_safe_lazy : ('a -> 'b -> bool) -> 'a safe_lazy -> 'b safe_lazy -> bool
Sourceval compare_safe_lazy : ('a -> 'b -> int) -> 'a safe_lazy -> 'b safe_lazy -> int
Sourceval hash_fold_safe_lazy : 'a -> Base.Hash.state -> 'b safe_lazy -> Base.Hash.state
Sourceval sexp_of_safe_lazy : ('a -> Base.Sexp.t) -> 'a safe_lazy -> Base.Sexp.t
Sourceval gcd : int -> int -> int
OCaml

Innovation. Community. Security.