package sarek

  1. Overview
  2. Docs
type customtypes =
  1. | KRecord of Camlp4.PreCast.Syntax.Ast.ctyp list * Camlp4.PreCast.Syntax.Ast.ident list * bool list
  2. | KSum of (string * Camlp4.PreCast.Syntax.Ast.ctyp option) list
type memspace =
  1. | Local
  2. | Global
  3. | Shared
  4. | Any
type ktyp =
  1. | TUnknown
  2. | TUnit
  3. | TInt32
  4. | TInt64
  5. | TFloat32
  6. | TFloat64
  7. | TBool
  8. | TAny
  9. | TVec of ktyp
  10. | TArr of ktyp * memspace
  11. | TApp of ktyp * ktyp
  12. | Custom of customtypes * string
val ktyp_to_string : ktyp -> string
val extensions : Camlp4.PreCast.Syntax.Ast.expr list ref
type var = {
  1. n : int;
  2. mutable var_type : ktyp;
  3. mutable is_mutable : bool;
  4. mutable read_only : bool;
  5. mutable write_only : bool;
  6. mutable is_global : bool;
}
val new_kernel : bool ref
exception ArgumentError
exception Unbound_value of string * Camlp4.PreCast.Syntax.Ast.Loc.t
exception Unbound_module of string * Camlp4.PreCast.Syntax.Ast.Loc.t
exception Immutable of string * Camlp4.PreCast.Syntax.Ast.Loc.t
exception TypeError of ktyp * ktyp * Camlp4.PreCast.Syntax.Ast.Loc.t
exception FieldError of string * string * Camlp4.PreCast.Syntax.Ast.Loc.t
type cfun = {
  1. nb_args : int;
  2. cuda_val : string;
  3. opencl_val : string;
  4. typ : ktyp;
}
type k_expr =
  1. | Open of Camlp4.PreCast.Syntax.Ast.Loc.t * Camlp4.PreCast.Syntax.Ast.ident * kexpr
  2. | App of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr list
  3. | Acc of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  4. | VecSet of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  5. | VecGet of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  6. | ArrSet of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  7. | ArrGet of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  8. | Seq of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  9. | Fun of Camlp4.PreCast.Syntax.Ast.Loc.t * Camlp4.PreCast.Syntax.Ast.expr * ktyp * cfun * string list
  10. | Bind of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr * kexpr * bool
  11. | Plus32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  12. | Plus64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  13. | PlusF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  14. | PlusF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  15. | Record of Camlp4.PreCast.Syntax.Ast.Loc.t * field list
  16. | RecGet of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * Camlp4.PreCast.Syntax.Ast.ident
  17. | RecSet of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  18. | Map of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr * kexpr
  19. | Min32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  20. | Min64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  21. | MinF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  22. | MinF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  23. | Mul32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  24. | Mul64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  25. | MulF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  26. | MulF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  27. | Mod of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  28. | Div32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  29. | Div64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  30. | DivF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  31. | DivF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  32. | Id of Camlp4.PreCast.Syntax.Ast.Loc.t * Camlp4.PreCast.Syntax.Ast.ident
  33. | Int of Camlp4.PreCast.Syntax.Ast.Loc.t * string
  34. | Int32 of Camlp4.PreCast.Syntax.Ast.Loc.t * string
  35. | Int64 of Camlp4.PreCast.Syntax.Ast.Loc.t * string
  36. | Float of Camlp4.PreCast.Syntax.Ast.Loc.t * string
  37. | Float32 of Camlp4.PreCast.Syntax.Ast.Loc.t * string
  38. | Float64 of Camlp4.PreCast.Syntax.Ast.Loc.t * string
  39. | BoolNot of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr
  40. | BoolAnd of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  41. | BoolOr of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  42. | BoolEq of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  43. | BoolEq32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  44. | BoolEq64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  45. | BoolEqF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  46. | BoolEqF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  47. | BoolLt of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  48. | BoolLt32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  49. | BoolLt64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  50. | BoolLtF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  51. | BoolLtF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  52. | BoolLtE of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  53. | BoolLtE32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  54. | BoolLtE64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  55. | BoolLtEF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  56. | BoolLtEF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  57. | BoolGt of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  58. | BoolGt32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  59. | BoolGt64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  60. | BoolGtF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  61. | BoolGtF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  62. | BoolGtE of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  63. | BoolGtE32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  64. | BoolGtE64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  65. | BoolGtEF32 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  66. | BoolGtEF64 of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  67. | Ife of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr * kexpr
  68. | If of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  69. | Match of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * case list
  70. | DoLoop of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr * kexpr * kexpr
  71. | While of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * kexpr
  72. | End of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr
  73. | Ref of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr
  74. | ModuleAccess of Camlp4.PreCast.Syntax.Ast.Loc.t * string * kexpr
  75. | True of Camlp4.PreCast.Syntax.Ast.Loc.t
  76. | False of Camlp4.PreCast.Syntax.Ast.Loc.t
  77. | TypeConstraint of Camlp4.PreCast.Syntax.Ast.Loc.t * kexpr * ktyp
  78. | Nat of Camlp4.PreCast.Syntax.Ast.Loc.t * Camlp4.PreCast.Syntax.Ast.expr
  79. | Pragma of Camlp4.PreCast.Syntax.Ast.Loc.t * string list * kexpr
  80. | Noop
and pattern =
  1. | Constr of string * Camlp4.PreCast.Syntax.Ast.ident option
and kexpr = {
  1. mutable t : ktyp;
  2. mutable e : k_expr;
  3. loc : Camlp4.PreCast.Syntax.Ast.Loc.t;
}
val is_unknown : ktyp -> bool
val update_type : kexpr -> ktyp -> unit
val string_of_ident : Camlp4.PreCast.Syntax.Ast.ident -> string
val k_expr_to_string : k_expr -> string
type k_patt
type spoc_module = {
  1. mod_name : string;
  2. mod_constants : (ktyp * string * string * string) list;
  3. mod_functions : (ktyp * string * int * string * string) list;
  4. mod_modules : (string, spoc_module) Hashtbl.t;
}
val return_type : ktyp ref
val arg_idx : int ref
val args : unit -> (string, var) Hashtbl.t
type recrd_field = {
  1. id : int;
  2. name : string;
  3. field : string;
  4. mutable ctyps : string list;
}
type cstr = {
  1. id : int;
  2. name : string;
  3. mutable nb_args : int;
  4. mutable ctyp : string;
  5. typ : customtypes;
}
type localfun = cfun * Camlp4.PreCast.Syntax.Ast.str_item * string list
val current_args : (string, var) Hashtbl.t ref
val intrinsics_fun : (string, cfun) Hashtbl.t ref
val global_fun : (string, cfun) Hashtbl.t ref
val local_fun : (string, localfun) Hashtbl.t ref
val intrinsics_const : (string, cfun) Hashtbl.t ref
val constructors : (string, cstr) Hashtbl.t ref
val rec_fields : (string, recrd_field) Hashtbl.t ref
val custom_types : (string, customtypes) Hashtbl.t
val n_lifted_vals : int ref
val new_arg_of_patt : Camlp4.PreCast.Syntax.Ast.patt -> unit
val std : spoc_module
val vector : spoc_module
val mathf32 : spoc_module
val mathf64 : spoc_module
val math : spoc_module
val modules : (string, spoc_module) Hashtbl.t
val open_module : string -> Camlp4.PreCast.Syntax.Ast.Loc.t -> unit
val close_module : string -> unit
val ctype_of_sarek_type : string -> string
val mltype_of_sarek_type : string -> string
val string_of_ctyp : Camlp4.PreCast.Syntax.Ast.ctyp -> string
val sarek_types_tbl : (string, string) Hashtbl.t
val get_sarek_name : string -> string
val ident_of_patt : 'a -> pattern -> int
val type_of_patt : pattern -> string