Spoc_core.Devicetype t = Spoc_framework.Device_type.t = {id : int;backend_id : int;name : string;framework : string;capabilities : Spoc_framework.Framework_sig.capabilities;}Device type from SDK
val devices : t array Stdlib.refDevice initialization state
Resolve a requested framework name to registered backend names. An exact name matches itself; a family name ("CUDA") matches every backend registered as "<family>/<variant>" ("CUDA/PTX", "CUDA/C"), highest priority first. Keeps callers written against the historical family names working after the plugin split.
val init : ?frameworks:string list -> unit -> t arrayInitialize all available backends and enumerate devices
val all : unit -> t arrayGet all initialized devices
val get : int -> t optionGet device by global ID
val first : unit -> t optionGet first available device (if any)
val by_framework : string -> t arrayFilter devices by framework
val with_fp64 : unit -> t arrayFilter devices by capability
CUDA backends register as "CUDA/PTX" and "CUDA/C"; match the family name or its slash-separated variants (not arbitrary "CUDA*" names).
val best : unit -> t optionGet the best device (first CUDA, then OpenCL, then Native)
Reset initialization state (for testing).
Retires the global id space, so every cache keyed on it must be dropped in the same breath. init restarts global_id at 0 over whichever frameworks it is handed, so the same id routinely denotes a DIFFERENT physical device after a reset: with ~frameworks:["OpenCL"] then ~frameworks:["Native"; "OpenCL"], the single Native device shifts OpenCL down one and id 1 moves from the second OpenCL device to the first. A surviving entry keyed on id 1 is then served to the wrong device, silently — a compiled kernel carries no device check — which is exactly the aliasing class this cache was keyed by device to prevent.
Only Sarek.Runtime's outer memo is affected: it keys on the global Device.t.id, while every per-backend cache keys on its own backend-local device index, which a reset does not perturb. So the notification here is enough, and it releases nothing — the listeners drop memoization only (see Spoc_framework.Cache_hooks), so unlike Kernel.clear_cache this cannot invalidate a handle a caller still holds.
val to_string : t -> stringPretty-print device info
val is_cuda : t -> boolval is_opencl : t -> boolval is_native : t -> boolval is_cpu : t -> boolval is_gpu : t -> boolval provides : t -> Sarek_ir_analysis.feature -> boolval allows_fp64 : t -> boolval allows_int64 : t -> boolval allows_fp16 : t -> boolval supports_atomics : t -> boolval compute_capability : t -> int * intval warp_size : t -> intval max_threads_per_block : t -> intval max_block_dims : t -> int * int * intval max_grid_dims : t -> int * int * intval total_memory : t -> int64val multiprocessor_count : t -> intval clock_rate_khz : t -> intval max_registers_per_block : t -> intval filter_cuda : unit -> t arrayval filter_opencl : unit -> t arrayval filter_native : unit -> t arrayval with_atomics : unit -> t arrayval with_min_memory : int64 -> t arrayval with_compute_capability : major:int -> minor:int -> t arrayval free_memory : t -> int64 optionQuery current free memory on device (if supported by backend)
val synchronize : t -> unitval set_current : t -> unit