C_syntax.Compile_driverRenders and compiles routines for a backend, attributing name-caused compile failures to the name.
module _ (_ : sig ... end) : C_syntax_configtype 'kparams rendered = {entries : ('kparams * Base.string * Low_level.launch_dims) Base.array;Per kernel, in batch order: its parameters, its emitted name and its launch geometry.
*)assemble : Base.int Base.list -> Base.string;The source of one translation unit holding the kernels at these indices, in the given order: the includes, the builtins those kernels use and their definitions, conditional includes applied. assemble of every index in order is the batch source compile_batch hands its compiler; assemble [i] is kernel i's standalone source, which a kernel code cache keys on (gh-ocannl-1314).
assemble_units : Base.int Base.list ->
max_units:Base.int ->
min_unit_bytes:Base.int ->
Base.string Base.list;gh-ocannl-1603: the same kernels as assemble as several translation units, to be compiled concurrently and linked into one library: their units -- a kernel, or an outlined kernel's parts and the kernel -- packed by size into at most max_units sources of at least about min_unit_bytes each (0: no minimum), each with its own prelude. One unit is [assemble idxs] exactly.
attribute : 'a. Base.int Base.list ->
Base.exn ->
Stdlib.Printexc.raw_backtrace ->
'a;Re-raises a failed compile of assemble idxs as compile_batch would: attributed to a routine's name when the report points at one of those kernels' declarations.
key_text : Base.int -> Base.string;Kernel i's standalone source as a kernel code cache keys it (gh-ocannl-1525): its prelude verbatim, its definition through Kernel_code_cache.canonical_kernel -- the names it owns (symbols, scope locals, its nodes' identifiers, the emitter's minted_derivations of them) renamed by first occurrence and its segment index dropped, so that an unchanged kernel keys alike whatever names the rest of the batch made it take. The backend adds the compiler options and looks the code up by the stored symbol.
}A batch rendered but not compiled: per-kernel entries, and source assemblers over kernel indices.
val render_batch :
names:Base.string Base.array ->
'a Indexing.bindings ->
Low_level.optimized Base.array ->
includes:Base.string ->
builtins:(Base.string * Base.string * Base.string Base.list) Base.list ->
?conditional_includes:(Base.string * Base.string) Base.list ->
Base.unit ->
(Base.string * Backend_intf.kparam_source) Base.list renderedRender a batch with one syntax instance over all of it, without compiling.
val binding_race :
name:Base.string ->
'a Indexing.bindings ->
Low_level.optimized ->
Base.string Base.optionbinding_race ~name bindings lowered: the detail of the hardware_binding_race refusal (gh-ocannl-959) that rendering lowered in this dialect raises, as compile would render it, or None where the render succeeds. Nothing is compiled and no text is returned. Any other refusal or exception of the render propagates, so a premise judged through this query cannot pass on an unrelated failure. The host-side seam of the GPU-gated binding-race premises (gh-ocannl-1780): a dialect that binds hardware registers, such as Cuda_like_config, answers the question on any host.
val drive :
batch:Base.bool ->
names:Base.string Base.array ->
'a Indexing.bindings ->
Low_level.optimized Base.array ->
includes:Base.string ->
builtins:(Base.string * Base.string * Base.string Base.list) Base.list ->
?conditional_includes:(Base.string * Base.string) Base.list ->
?compiles_source:Base.bool ->
compile_source:(name:Base.string -> Base.string -> 'b) ->
Base.unit ->
'b
* ((Base.string * Backend_intf.kparam_source) Base.list
* Base.string
* Low_level.launch_dims)
Base.arrayRender kernels into one source and compile it, attributing name-caused failures to the name.
val compile :
name:Base.string ->
'a Indexing.bindings ->
Low_level.optimized ->
includes:Base.string ->
builtins:(Base.string * Base.string * Base.string Base.list) Base.list ->
?conditional_includes:(Base.string * Base.string) Base.list ->
?compiles_source:Base.bool ->
compile_source:(name:Base.string -> Base.string -> 'b) ->
Base.unit ->
'b
* (Base.string * Backend_intf.kparam_source) Base.list
* Base.string
* Low_level.launch_dimsdrive for one routine: the compile's result, its parameters, emitted name and launch geometry.
val compile_batch :
names:Base.string Base.array ->
'a Indexing.bindings ->
Low_level.optimized Base.array ->
includes:Base.string ->
builtins:(Base.string * Base.string * Base.string Base.list) Base.list ->
?conditional_includes:(Base.string * Base.string) Base.list ->
?compiles_source:Base.bool ->
compile_source:(name:Base.string -> Base.string -> 'b) ->
Base.unit ->
'b
* ((Base.string * Backend_intf.kparam_source) Base.list
* Base.string
* Low_level.launch_dims)
Base.arraydrive for a batch, compiled as one source named by the routines' common prefix.