Sarek_ppx_lib.Sarek_ir_ppxVariables with type info
type expr = | EConst of const| EVar of var| EBinop of binop * expr * expr| EUnop of unop * expr| EArrayRead of string * expr| EArrayReadExpr of expr * expr| ERecordField of expr * string| EIntrinsic of string list * string * expr list| ECast of elttype * expr| ETuple of expr list| EApp of expr * expr list| ERecord of string * (string * expr) list| EVariant of string * string * expr list| EArrayLen of string| EArrayCreate of elttype * expr * memspaceelem type, size, memspace
*)| EIf of expr * expr * expr| EMatch of expr * (pattern * expr) listExpressions (pure, no side effects)
type stmt = | SAssign of lvalue * expr| SSeq of stmt list| SIf of expr * stmt * stmt option| SWhile of expr * stmt| SFor of var * expr * expr * for_dir * stmt| SMatch of expr * (pattern * stmt) list| SReturn of expr| SBarrier| SWarpBarrier| SExpr of expr| SEmpty| SLet of var * expr * stmt| SLetMut of var * expr * stmt| SPragma of string list * stmt| SMemFence| SBlock of stmtScoped block for C variable isolation
*)| SNative of {gpu : Ppxlib.expression;fun dev -> "cuda/opencl code"
*)ocaml : Ppxlib.expression;OCaml fallback for interpreter/native
*)}Inline native GPU code with OCaml fallback
*)Statements (imperative, side effects)
Declarations
Helper function (device function called from kernel)
type kernel = {kern_name : string;kern_params : decl list;kern_locals : decl list;kern_body : stmt;kern_types : (string * (string * elttype) list) list;Record type definitions: (type_name, (field_name, field_type); ...)
kern_variants : (string * (string * elttype list) list) list;Variant type definitions: (type_name, (constructor_name, payload_types); ...)
kern_funcs : helper_func list;Helper functions defined in kernel scope
*)kern_native_fn : unit option;Placeholder for native function - actual function added during quoting
*)}Kernel representation