Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/tree-ir/tree-ir.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/tree-ir/tree-ir.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3848, Thu May 12 14:30:19 2016 UTC revision 4045, Sun Jun 26 14:54:01 2016 UTC
# Line 15  Line 15 
15      structure Op = TreeOps      structure Op = TreeOps
16      structure Ty = TreeTypes      structure Ty = TreeTypes
17    
18        type target_info = {
19            layout : int -> TreeTypes.vec_layout,
20            isInline : LowOps.rator -> bool
21          }
22    
23      datatype program = Program of {      datatype program = Program of {
24          props : Properties.t list,          props : Properties.t list,
25            target : target_info,           (* target-specific info about representation invariants *)
26          consts : global_var list,       (* large constant variables *)          consts : global_var list,       (* large constant variables *)
27          inputs : input list,            (* global input variables *)          inputs : input list,            (* global input variables *)
28          constInit : block,              (* code that initializes constants and inputs *)          constInit : block,              (* code that initializes constants and inputs *)
29          globals : global_var list,      (* other global variables *)          globals : global_var list,      (* other global variables *)
30          globalInit : block,             (* CFG to initialize other globals (if any) *)          globInit : block,               (* CFG to initialize other globals (if any) *)
31          strand : strand,                (* the strand definition *)          strand : strand,                (* the strand definition *)
32          create : create,                (* initial strand creation *)          create : create,                (* initial strand creation *)
33          update : block option           (* optional update code. *)          init : block option,            (* optional global initially code *)
34            update : block option           (* optional global update code. *)
35        }        }
36    
37      and strand = Strand of {      and strand = Strand of {
38          name : Atom.atom,          name : Atom.atom,
39          params : var list,          params : var list,
40          state : state_var list,          state : state_var list,
41          stateInit : block,          stateInit : method,
42          initM : block option,          initM : method option,
43          updateM : block,          updateM : method,
44          stabilizeM : block option          stabilizeM : method option
45        }        }
46    
47      and create = Create of {      and method = Method of {
48          dim : int option,               (* grid dimension; NONE for collections *)            usesGlobals : bool,           (* does the method contain references to globals? *)
49          code : block                    (* the loop nest for creating the strands *)            needsWorld : bool,            (* does the method need the world (e.g., to print) *)
50              body : block                  (* the method body *)
51        }        }
52    
53      and block = Block of {      and block = Block of {
# Line 49  Line 57 
57    
58      and stm      and stm
59        = S_Comment of string list        = S_Comment of string list
60        | S_Unpack of var list * exp      (* unpack vector pieces into local variables *)        | S_Assign of bool * var * exp    (* assignment; the boolean is true for var decls *)
       | S_Assign of var * exp  
61        | S_MAssign of var list * exp        | S_MAssign of var list * exp
62        | S_GAssign of global_var * exp        | S_GAssign of global_var * exp
63        | S_IfThen of exp * block        | S_IfThen of exp * block
64        | S_IfThenElse of exp * block * block        | S_IfThenElse of exp * block * block
65          | S_For of var * exp * exp * block
66        | S_Foreach of var * exp * block        | S_Foreach of var * exp * block
67      (* special Diderot forms *)      (* special Diderot forms *)
68        | S_LoadNrrd of var * string        | S_LoadNrrd of var * APITypes.t * string
69        | S_Input of global_var * string * string option * exp option (* get input *)        | S_Input of global_var * string * string option * exp option (* get input *)
70        | S_InputNrrd of global_var * string * string option * string option (* get image/seq input *)        | S_InputNrrd of global_var * string * string option * string option (* get image/seq input *)
71        | S_New of Atom.atom * exp list   (* new strand creation *)        | S_New of Atom.atom * exp list   (* new strand creation *)
72        | S_Save of state_var * exp  (* save strand state *)        | S_Save of state_var * exp  (* save strand state *)
73    (* QUESTION: do we need S_Exit? *)
74        | S_Exit        | S_Exit
75        | S_Print of Ty.t list * exp list        | S_Print of Ty.t list * exp list
76      (* return functions for methods *)      (* return functions for methods *)
# Line 71  Line 80 
80    
81      and exp      and exp
82        = E_Global of global_var        = E_Global of global_var
83        | E_State of var option * state_var        | E_State of exp option * state_var
84        | E_Var of var        | E_Var of var
85        | E_Lit of Literal.t        | E_Lit of Literal.t
86        | E_Op of Op.rator * exp list        | E_Op of Op.rator * exp list
87        | E_Cons of exp list * Ty.t        | E_Vec of int * int * exp list           (* vector value; the ints are the width and the
88                                                     * padded width
89                                                     *)
90          | E_Cons of exp list * Ty.t               (* in-memory tensor value *)
91        | E_Seq of exp list * Ty.t        | E_Seq of exp list * Ty.t
92        | E_Pack of exp list              (* pack vector pieces into composite vector value *)        | E_Pack of Ty.vec_layout * exp list      (* pack vector pieces into composite vector value *)
93        | E_VLoad of Ty.vec_layout * exp * int (* load a piece of a composite vector value *)        | E_VLoad of Ty.vec_layout * exp * int    (* load a piece of a composite vector value from
94                                                     * a tensor.  The integer specifies the index of
95                                                     * the piece.
96                                                     *)
97    
98      and global_var = GV of {      and global_var = GV of {
99          name : string,                  (* name (should be unique) *)          name : string,                  (* name (should be unique) *)
# Line 103  Line 118 
118        }        }
119    
120      withtype input = global_var Inputs.input      withtype input = global_var Inputs.input
121             and create = block Create.t
122    
123    end    end

Legend:
Removed from v.3848  
changed lines
  Added in v.4045

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0