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

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/simplify/simple.sml
ViewVC logotype

Diff of /branches/lamont/src/compiler/simplify/simple.sml

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

revision 2297, Fri Mar 15 22:05:31 2013 UTC revision 2298, Fri Mar 15 22:18:22 2013 UTC
# Line 23  Line 23 
23          inputs : (var * Types.ty Inputs.input) list,          inputs : (var * Types.ty Inputs.input) list,
24          globals : var list,          globals : var list,
25          globalInit : block,          globalInit : block,
26      globalBlock: block,          funcs : func list,
     globalReduce: block,  
27          strands : strand list,          strands : strand list,
28            globalBlock : block,
29          init : init                     (* block evaluates any vars used in init *)          init : init                     (* block evaluates any vars used in init *)
30        }        }
31    
32        and func = Func of {
33            f : var,
34            params : var list,
35            body : block
36          }
37    
38      and init = Initially of {      and init = Initially of {
39          isArray : bool,          isArray : bool,
40          rangeInit : block,          rangeInit : block,
# Line 42  Line 48 
48          args : var list          args : var list
49        }        }
50    
51    (* do we use this?
52      and iter = I_Range of {      and iter = I_Range of {
53          rangeInit : block,          rangeInit : block,
54          param : var,          param : var,
55          lo : var,          lo : var,
56          hi : var          hi : var
57        }        }
58    *)
59    
60      and strand = Strand of {      and strand = Strand of {
61          name : Atom.atom,          name : Atom.atom,
# Line 71  Line 79 
79        | S_New of Atom.atom * var list        | S_New of Atom.atom * var list
80        | S_Die        | S_Die
81        | S_Stabilize        | S_Stabilize
82          | S_Return of var
83        | S_Print of var list        | S_Print of var list
84    
85      and exp      and exp
# Line 105  Line 114 
114            val d = List.length xs + 1            val d = List.length xs + 1
115            val ty = Var.monoTypeOf x            val ty = Var.monoTypeOf x
116            in            in
117              case ty              case TypeUtil.pruneHead ty
118               of Types.T_Tensor shape => Types.T_Tensor(Types.shapeExt(shape, Types.DimConst d))               of Types.T_Tensor shape => Types.T_Tensor(Types.shapeExt(shape, Types.DimConst d))
119                | _ => raise Fail "element of tensor construction not tensor"                | _ => raise Fail(concat[
120                        "element of tensor construction is ", TypeUtil.toString ty, ", expected tensor"
121                      ])
122              (* end case *)              (* end case *)
123            end            end
124        | typeOf (E_Seq[]) = raise Fail "empty sequence not supported yet"        | typeOf (E_Seq[]) = raise Fail "empty sequence not supported yet"
125        | typeOf (E_Seq(x::xs)) = let        | typeOf (E_Seq(x::xs)) = let
126            val d = List.length xs + 1            val d = List.length xs + 1
127            val ty = Var.monoTypeOf x            val ty = TypeUtil.pruneHead(Var.monoTypeOf x)
128            in            in
129              Types.T_Sequence(ty, Types.DimConst d)              Types.T_Sequence(ty, Types.DimConst d)
130            end            end

Legend:
Removed from v.2297  
changed lines
  Added in v.2298

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