Module Realize.Runner

Common dispatch interface.

A runner wraps a single dispatchable operation (compiled kernel, buffer copy, view). Dispatch takes a list of buffers and name-keyed variable bindings and optionally returns execution time.

type t

The type for runners.

val make : display_name:string -> device:Device.t -> ?estimates:Program_spec.Estimates.t -> (Device.Buffer.t list -> (string * int) list -> wait:bool -> timeout:int option -> float option) -> t

make ~display_name ~device ?estimates call is a runner that dispatches via call.

estimates defaults to Program_spec.Estimates.zero.

val dev : t -> Device.t

dev t is t's device.

val display_name : t -> string

display_name t is t's human-readable name for debug output.

val estimates : t -> Program_spec.Estimates.t

estimates t is t's cost estimates.

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 operation on bufs with variable bindings var_vals.

Returns Some time when wait is true and the backend supports timing, None otherwise.

val exec : t -> Device.Buffer.t list -> ?var_vals:(string * int) list -> unit -> float option

exec t bufs ?var_vals () is call with ~wait:false and ~timeout:None. Always returns None.

var_vals defaults to [].