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

SCM Repository

[diderot] Diff of /trunk/src/compiler/high-il/high-il-types.sml
ViewVC logotype

Diff of /trunk/src/compiler/high-il/high-il-types.sml

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

revision 393, Thu Oct 14 15:45:01 2010 UTC revision 403, Thu Oct 14 22:11:13 2010 UTC
# Line 7  Line 7 
7  structure HighILTypes =  structure HighILTypes =
8    struct    struct
9    
10      datatype ty = BoolTy | StringTy | IntTy | TensorTy of int list      datatype ty
11          = BoolTy | StringTy | IntTy
12          | TensorTy of int list
13          | KernelTy | ImageTy | FieldTy
14    
15        val realTy = TensorTy[]
16        val vec3Ty = TensorTy[3]
17    
18      fun same (ty1 : ty, ty2) = (ty1 = ty2)      fun same (ty1 : ty, ty2) = (ty1 = ty2)
19    
# Line 15  Line 21 
21        | hash StringTy = 0w2        | hash StringTy = 0w2
22        | hash IntTy = 0w3        | hash IntTy = 0w3
23        | hash (TensorTy dd) = List.foldl (fn (d, s) => Word.fromInt d + s) 0w4 dd        | hash (TensorTy dd) = List.foldl (fn (d, s) => Word.fromInt d + s) 0w4 dd
24          | hash KernelTy = 0w5
25          | hash ImageTy = 0w6
26          | hash FieldTy = 0w7
27    
28      fun toString BoolTy = "bool"      fun toString BoolTy = "bool"
29        | toString StringTy = "string"        | toString StringTy = "string"
# Line 23  Line 32 
32        | toString (TensorTy dd) = String.concat[        | toString (TensorTy dd) = String.concat[
33              "tensor[", String.concatWith "," (List.map Int.toString dd), "]"              "tensor[", String.concatWith "," (List.map Int.toString dd), "]"
34            ]            ]
35          | toString KernelTy = "kernel"
36          | toString ImageTy = "image"
37          | toString FieldTy = "field"
38    
39    end    end

Legend:
Removed from v.393  
changed lines
  Added in v.403

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