Spoc_framework.Backend_errortype codegen_error = | Unknown_intrinsic of {}Intrinsic function not recognized by this backend
*)| Invalid_arg_count of {}Wrong number of arguments to intrinsic
*)| Unsupported_construct of {}IR construct not supported by this backend
*)| Type_error of {}Type mismatch in expression
*)| Invalid_memory_space of {}Invalid memory space qualifier for declaration
*)| Unsupported_type of {}Type not supported by backend (e.g., fp64 without cl_khr_fp64)
*)Error types for backend code generation (IR → source translation)
type runtime_error = | No_device_selected of {}Operation requires a device but none is set
*)| Device_not_found of {}Device ID out of range
*)| Compilation_failed of {}Kernel compilation failed
*)| Module_load_failed of {}Failed to load compiled module/program
*)| Kernel_launch_failed of {}Failed to launch kernel on device
*)| Memory_allocation_failed of {}Device memory allocation failed
*)| Memory_copy_failed of {}Memory transfer between host and device failed
*)| Context_error of {}GPU context creation/management failed
*)| Synchronization_failed of {}Device synchronization failed
*)Error types for backend runtime operations
type plugin_error = Error types for backend plugin operations
type t = | Codegen of {backend : string;error : codegen_error;}| Runtime of {backend : string;error : runtime_error;}| Plugin of {backend : string;error : plugin_error;}Union type for backend errors, parameterized by backend name
exception Backend_error of tException wrapper for backend errors
val codegen : backend:string -> codegen_error -> tCreate codegen error for a specific backend
val runtime : backend:string -> runtime_error -> tCreate runtime error for a specific backend
val plugin : backend:string -> plugin_error -> tCreate plugin error for a specific backend
val unknown_intrinsic : backend:string -> string -> tval invalid_arg_count : backend:string -> string -> int -> int -> tval unsupported_construct : backend:string -> string -> string -> tval type_error : backend:string -> string -> string -> string -> tval invalid_memory_space : backend:string -> string -> string -> tval unsupported_type : backend:string -> string -> tval no_device_selected : backend:string -> string -> tval device_not_found : backend:string -> int -> int -> tval compilation_failed : backend:string -> string -> string -> tval module_load_failed : backend:string -> int -> string -> tval kernel_launch_failed : backend:string -> string -> string -> tval memory_allocation_failed : backend:string -> int64 -> string -> tval memory_copy_failed : backend:string -> string -> int -> string -> tval context_error : backend:string -> string -> string -> tval synchronization_failed : backend:string -> string -> tval unsupported_source_lang : backend:string -> string -> tval library_not_found : backend:string -> string -> string list -> tval initialization_failed : backend:string -> string -> tval feature_not_supported : backend:string -> string -> tval to_string : t -> stringConvert error to human-readable string
val raise_error : t -> 'aRaise backend error as exception
val print_error : t -> unitPrint error to stderr
val to_result : (unit -> 'a) -> ('a, t) Stdlib.resultConvert error to Result type
val result_to_string : ('a, t) Stdlib.result -> ('a, string) Stdlib.resultMap Result error to string