Sarek_ppx_lib.Sarek_astSource locations
val dummy_loc : locval loc_of_ppxlib : Ppxlib.Location.t -> locval loc_to_ppxlib : loc -> Ppxlib.Location.tMemory spaces for arrays
Patterns for match expressions
Kernel parameters - defined before expr so ELetRec can reference it
and expr_desc = | EUnit| EBool of bool| EInt of intint literal (will be int32 in kernel)
*)| EInt32 of int32| EInt64 of int64| EFloat of floatfloat32
*)| EDouble of floatfloat64
*)| EVar of string| EVecGet of expr * exprv.i - vector element access
| EVecSet of expr * expr * exprv.i <- x
| EArrGet of expr * expra.(i) - array element access
*)| EArrSet of expr * expr * expra.(i) <- x
*)| EFieldGet of expr * stringr.field
*)| EFieldSet of expr * string * exprr.field <- x
*)| EBinop of binop * expr * expr| EUnop of unop * expr| EApp of expr * expr listf x y
*)| EAssign of string * exprx := e
*)| ELet of string * type_expr option * expr * exprlet x : t = e1 in e2
*)| ELetRec of string * param list * type_expr option * expr * exprlet rec f params : ret_ty = body in cont
*)| ELetMut of string * type_expr option * expr * exprlet mutable x = ...
*)| EIf of expr * expr * expr optionif c then a else b
| EFor of string * expr * expr * for_dir * exprfor i = a to/downto b do ... done
*)| EWhile of expr * expr| ESeq of expr * expr| EMatch of expr * (pattern * expr) list| ERecord of string option * (string * expr) listRecord literal with optional type name
*)| EConstr of string * expr optionConstructor application
*)| ETuple of expr list(a, b, c)
*)| EReturn of expr| ECreateArray of expr * type_expr * memspace| EGlobalRef of stringReference to OCaml value by name
*)| ENative of {gpu : Ppxlib.expression;fun dev -> "cuda/opencl code"
*)ocaml : Ppxlib.expression;fun arg1 arg2 ... -> OCaml fallback
*)}Native code with GPU string generator and OCaml fallback function. Usage: %native (fun dev -> "code"), (fun x y -> ...) x y The result is a function that takes the same args as the ocaml fallback.
| EPragma of string list * exprpragma "unroll" body
*)| ETyped of expr * type_expr| EOpen of string list * exprlet open M.N in e
*)| ESuperstep of string * bool * expr * exprlet%superstep ~divergent name = body in cont
type kernel = {kern_name : string option;None for anonymous kernels
*)kern_types : type_decl list;Type declarations visible in body
*)kern_module_items : module_item list;Module-level items visible in body
*)kern_external_item_count : int;Number of items in kern_module_items that are external (from @sarek.module). First N items are external, rest are inline.
kern_params : param list;kern_body : expr;kern_loc : loc;}A complete kernel definition
val pp_type_expr : Stdlib.Format.formatter -> type_expr -> unitPretty printing for debugging
val pp_binop : Stdlib.Format.formatter -> binop -> unitval pp_unop : Stdlib.Format.formatter -> unop -> unitval pp_memspace : Stdlib.Format.formatter -> memspace -> unitval pp_pattern : Stdlib.Format.formatter -> pattern -> unitval pp_expr : Stdlib.Format.formatter -> expr -> unitval pp_param : Stdlib.Format.formatter -> param -> unitval pp_kernel : Stdlib.Format.formatter -> kernel -> unit