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

SCM Repository

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

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

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

revision 1793, Thu Apr 5 09:53:28 2012 UTC revision 2016, Tue Oct 9 03:22:30 2012 UTC
# Line 16  Line 16 
16      datatype var = datatype AST.var      datatype var = datatype AST.var
17    
18      datatype program = Program of {      datatype program = Program of {
19            inputs : (var * Types.ty Inputs.input) list,
20          globals : var list,          globals : var list,
21          globalInit : block,          globalInit : block,
22          strands : strand list,          strands : strand list,
# Line 73  Line 74 
74        | E_Cons of var list        | E_Cons of var list
75        | E_Seq of var list        | E_Seq of var list
76        | E_Slice of var * var option list * Types.ty     (* tensor slicing *)        | E_Slice of var * var option list * Types.ty     (* tensor slicing *)
       | E_Input of Types.ty * string * string * var option  
       | E_LoadImage of ImageInfo.info * var  
77        | E_Coerce of {srcTy : Types.ty, dstTy : Types.ty, x : var}        | E_Coerce of {srcTy : Types.ty, dstTy : Types.ty, x : var}
78    
79      fun typeOf (E_Var x) = Var.monoTypeOf x      fun typeOf (E_Var x) = Var.monoTypeOf x
# Line 86  Line 85 
85            (* end case *))            (* end case *))
86        | typeOf (E_Tuple _) = raise Fail "E_Tuple"        | typeOf (E_Tuple _) = raise Fail "E_Tuple"
87        | typeOf (E_Apply(_, _, _, ty)) = ty        | typeOf (E_Apply(_, _, _, ty)) = ty
88          | typeOf (E_Cons[]) = raise Fail "impossible empty E_Cons"
89        | typeOf (E_Cons(x::xs)) = let        | typeOf (E_Cons(x::xs)) = let
90            val d = List.length xs + 1            val d = List.length xs + 1
91            val ty = Var.monoTypeOf x            val ty = Var.monoTypeOf x
# Line 95  Line 95 
95                | _ => raise Fail "element of tensor construction not tensor"                | _ => raise Fail "element of tensor construction not tensor"
96              (* end case *)              (* end case *)
97            end            end
       | typeOf (E_Cons[]) = raise Fail "impossible empty E_Cons"  
98        | typeOf (E_Seq[]) = raise Fail "empty sequence not supported yet"        | typeOf (E_Seq[]) = raise Fail "empty sequence not supported yet"
99        | typeOf (E_Seq(x::xs)) = let        | typeOf (E_Seq(x::xs)) = let
100            val d = List.length xs + 1            val d = List.length xs + 1
# Line 104  Line 103 
103              Types.T_Sequence(ty, Types.DimConst d)              Types.T_Sequence(ty, Types.DimConst d)
104            end            end
105        | typeOf (E_Slice(_, _, ty)) = ty        | typeOf (E_Slice(_, _, ty)) = ty
106        | typeOf (E_Input(ty, _, _, _)) = ty        | typeOf (E_Coerce{dstTy, ...}) = dstTy
       | typeOf (E_LoadImage(info, _)) =  
           Types.T_Image{  
               dim = Types.DimConst(ImageInfo.dim info),  
               shape = Types.Shape(List.map Types.DimConst (ImageInfo.voxelShape info))  
             }  
107    
108    end    end

Legend:
Removed from v.1793  
changed lines
  Added in v.2016

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