Module Sarek_pure_registry

val fun_registry : (string list * string, framework:string -> string) Stdlib.Hashtbl.t

Pure function registry: no Device.t, no ctypes.

val register_fun : ?module_path:string list -> string -> device:(framework:string -> string) -> unit

Register a pure intrinsic function. module_path is the qualified path, e.g. ["Float32"] for Float32.sin. name is the unqualified function name. device is a closure ~framework:string -> string returning the device-code name to emit for a given backend framework string.

val fun_device_template : ?module_path:string list -> string -> (framework:string -> string) option

Look up device-code name for a path-qualified function. Returns None if not found.

val float32_math_template : cuda_name:'a -> generic_name:'a -> framework:string -> 'a

Build a framework-dispatching closure for float32 math functions. CUDA uses the f-suffixed form (sinf, cosf, …); OpenCL, Metal, and GLSL use the un-suffixed form.