Module Realize.Compiled_runner

Kernel compilation and dispatch.

A compiled runner wraps a Program_spec.t, compiles it if its Program_spec.lib is None, creates a Runtime program handle handle via Device.runtime, and dispatches kernels through it.

type t

The type for compiled runners.

val create : device:Device.t -> ?prg:Device.prog -> Program_spec.t -> t

create ~device ?prg p is a compiled runner for p on device.

When Program_spec.lib p is None, the source is compiled via the device's Renderer.compiler.

prg overrides the Runtime program handle handle. When None (default), one is created via Device.runtime.

Raises Invalid_argument if the device has no compiler and p has no compiled binary.

val p : t -> Program_spec.t

p t is t's program spec.

val runner : t -> Runner.t

runner t is t's underlying runner.

val call : t -> Device.Buffer.t list -> (string * int) list -> wait:bool -> timeout:int option -> float option

call t bufs var_vals ~wait ~timeout dispatches the kernel on bufs with variable bindings var_vals.

See Runner.call for the return value semantics.