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

SCM Repository

[diderot] Diff of /trunk/src/compiler/IL/types.sml
ViewVC logotype

Diff of /trunk/src/compiler/IL/types.sml

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

revision 8, Fri Jan 8 21:50:42 2010 UTC revision 9, Fri Jan 8 22:06:11 2010 UTC
# Line 2  Line 2 
2   *   *
3   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5     *
6     * This file defines the internal representation of Diderot types.  Most values
7     * have the tensor type, which includes scalars, vectors, etc.  The internal
8     * type system supports polymorphism, which is used to give types to higher-order
9     * operators (e.g., derivatives).
10   *)   *)
11    
12  structure Types =  structure Types =
# Line 97  Line 102 
102              wellFormed' ty              wellFormed' ty
103            end            end
104    
105      (* some common types *)
106        local
107          fun scalarTy rty = T_Tensor{order=[], ty=rty}
108          fun vecTy (d, rty) = T_Tensor{order=[DIM d], ty=rty}
109        in
110        val intTy = scalarTy RT_Int32
111        val int2Ty = vecTy (0w2, RT_Int32)
112        val intT3y = vecTy (0w3, RT_Int32)
113        val intT4y = vecTy (0w4, RT_Int32)
114        val uintTy = scalarTy RT_UInt32
115        val uint2Ty = vecTy (0w2, RT_UInt32)
116        val uintT3y = vecTy (0w3, RT_UInt32)
117        val uintT4y = vecTy (0w4, RT_UInt32)
118        val floatTy = scalarTy RT_Float
119        val float2Ty = vecTy (0w2, RT_Float)
120        val floatT3y = vecTy (0w3, RT_Float)
121        val floatT4y = vecTy (0w4, RT_Float)
122        val doubleTy = scalarTy RT_Double
123        val double2Ty = vecTy (0w2, RT_Double)
124        val double3Ty = vecTy (0w3, RT_Double)
125        val double4Ty = vecTy (0w4, RT_Double)
126        end (* local *)
127    
128      (* new type variables *)
129        fun newVar k = TV{kind=k, stamp=Stamp.new()}
130    
131    end    end

Legend:
Removed from v.8  
changed lines
  Added in v.9

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