Module Sarek_ppx_lib.Kirc_Ast

type kernel
and kvect =
  1. | IntVect of int
  2. | Floatvect of int
type intrinsics = string * string
type elttype =
  1. | EInt32
  2. | EInt64
  3. | EFloat32
  4. | EFloat64
type memspace =
  1. | LocalSpace
  2. | Global
  3. | Shared
type k_ext =
  1. | Kern of k_ext * k_ext
  2. | Block of k_ext
  3. | Params of k_ext
  4. | Plus of k_ext * k_ext
  5. | Plusf of k_ext * k_ext
  6. | Min of k_ext * k_ext
  7. | Minf of k_ext * k_ext
  8. | Mul of k_ext * k_ext
  9. | Mulf of k_ext * k_ext
  10. | Div of k_ext * k_ext
  11. | Divf of k_ext * k_ext
  12. | Mod of k_ext * k_ext
  13. | Id of string
  14. | IdName of string
  15. | GlobalFun of k_ext * string * string
  16. | IntVar of int * string * bool
  17. | FloatVar of int * string * bool
  18. | UnitVar of int * string * bool
  19. | CastDoubleVar of int * string
  20. | DoubleVar of int * string * bool
  21. | BoolVar of int * string * bool
  22. | Arr of string * k_ext * elttype * memspace
  23. | VecVar of k_ext * int * string
  24. | Concat of k_ext * k_ext
  25. | Constr of string * string * k_ext list
  26. | Record of string * k_ext list
  27. | RecGet of k_ext * string
  28. | RecSet of k_ext * k_ext
  29. | Empty
  30. | Seq of k_ext * k_ext
  31. | Return of k_ext
  32. | Set of k_ext * k_ext
  33. | Decl of k_ext
  34. | SetV of k_ext * k_ext
  35. | SetLocalVar of k_ext * k_ext * k_ext
  36. | Intrinsics of intrinsics
  37. | IntrinsicRef of string list * string
    (*

    module_path * name: looked up in registry at JIT

    *)
  38. | IntId of string * int
  39. | Int of int
  40. | Float of float
  41. | Double of float
  42. | Custom of string * int * string
  43. | CustomVar of string * string * string
  44. | IntVecAcc of k_ext * k_ext
  45. | Local of k_ext * k_ext
  46. | Acc of k_ext * k_ext
  47. | Ife of k_ext * k_ext * k_ext
  48. | If of k_ext * k_ext
  49. | Match of string * k_ext * case array
  50. | Or of k_ext * k_ext
  51. | And of k_ext * k_ext
  52. | Not of k_ext
  53. | EqCustom of string * k_ext * k_ext
  54. | EqBool of k_ext * k_ext
  55. | LtBool of k_ext * k_ext
  56. | GtBool of k_ext * k_ext
  57. | LtEBool of k_ext * k_ext
  58. | GtEBool of k_ext * k_ext
  59. | DoLoop of k_ext * k_ext * k_ext * k_ext
  60. | While of k_ext * k_ext
  61. | App of k_ext * k_ext array
  62. | GInt of unit -> int32
  63. | GFloat of unit -> float
  64. | GFloat64 of unit -> float
  65. | GIntVar of string
    (*

    Global int32 variable by name - for PPX quoting

    *)
  66. | GFloatVar of string
    (*

    Global float32 variable by name - for PPX quoting

    *)
  67. | GFloat64Var of string
    (*

    Global float64 variable by name - for PPX quoting

    *)
  68. | Native of Spoc_core.Device.t -> string
  69. | NativeWithFallback of {
    1. gpu : Ppxlib.expression;
      (*

      fun dev -> "cuda/opencl code"

      *)
    2. ocaml : Ppxlib.expression;
      (*

      OCaml fallback for interpreter/native

      *)
    }
    (*

    Native code with GPU and OCaml fallback expressions - for PPX quoting

    *)
  70. | Pragma of string list * k_ext
  71. | Map of k_ext * k_ext * k_ext
  72. | Unit
and case = int * (string * string * int * string) option * k_ext
type kfun =
  1. | KernFun of k_ext * k_ext
val string_of_ast : k_ext -> string
val print_ast : k_ext -> unit