Module Tolk_metal.State

type t

The type for Metal device state. Holds the GPU device handle, command queue, shared timeline event, and in-flight command buffer list.

val create : unit -> t

create () initializes the system default Metal device, command queue, and shared event.

Raises Failure if no Metal GPU is available.

val synchronize : t -> unit

synchronize t blocks until all in-flight command buffers complete. After return, the in-flight list is empty.

Raises Failure if any command buffer completed with an error.

val shutdown : t -> unit

shutdown t synchronizes and releases all Metal resources (command queue, shared event, device). Subsequent calls are no-ops.

val is_virtual : t -> bool

is_virtual t is true iff the device name contains "virtual", indicating a paravirtualized Metal device (e.g. macOS VM). ICB-based graph execution is unreliable on virtual devices.