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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/mid-il/check-mid-il.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/mid-il/check-mid-il.sml

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

revision 1925, Sat Jun 23 14:16:09 2012 UTC revision 2027, Thu Oct 11 10:40:12 2012 UTC
# Line 47  Line 47 
47              | Op.MulVecMat(d1, d2) => (Ty.vecTy d2, [Ty.vecTy d1, Ty.TensorTy[d1, d2]])              | Op.MulVecMat(d1, d2) => (Ty.vecTy d2, [Ty.vecTy d1, Ty.TensorTy[d1, d2]])
48              | Op.MulMatVec(d1, d2) => (Ty.vecTy d1, [Ty.TensorTy[d1, d2], Ty.vecTy d2])              | Op.MulMatVec(d1, d2) => (Ty.vecTy d1, [Ty.TensorTy[d1, d2], Ty.vecTy d2])
49              | Op.MulMatMat(d1, d2, d3) => (Ty.TensorTy[d1, d3], [Ty.TensorTy[d1, d2], Ty.TensorTy[d2, d3]])              | Op.MulMatMat(d1, d2, d3) => (Ty.TensorTy[d1, d3], [Ty.TensorTy[d1, d2], Ty.TensorTy[d2, d3]])
50                | Op.MulVecTen3(d1, d2, d3) => (Ty.TensorTy[d2, d3], [Ty.vecTy d1, Ty.TensorTy[d1, d2, d3]])
51                | Op.MulTen3Vec(d1, d2, d3) => (Ty.TensorTy[d1, d2], [Ty.TensorTy[d1, d2, d3], Ty.vecTy d3])
52                | Op.ColonMul(ty1 as Ty.TensorTy dd1, ty2 as Ty.TensorTy(d21::d22::dd2)) => let
53                    fun last2 ([d1, d2], prefix) = (prefix, d1, d2)
54                      | last2 (d::dd, prefix) = last2(dd, d::prefix)
55                      | last2 _ = raise Fail("sigOf: invalid operator " ^ Op.toString rator)
56                    val (prefix, d11, d12) = last2 (dd1, [])
57                    in
58                      if (d11 <> d21) orelse (d12 <> d22)
59                        then raise Fail("sigOf: invalid operator " ^ Op.toString rator)
60                        else (Ty.TensorTy(List.revAppend(prefix, dd2)), [ty1, ty2])
61                    end
62              | Op.Cross => (vec3Ty, [vec3Ty, vec3Ty])              | Op.Cross => (vec3Ty, [vec3Ty, vec3Ty])
63              | Op.Norm(ty as Ty.TensorTy _) => (Ty.realTy, [ty])              | Op.Norm(ty as Ty.TensorTy _) => (Ty.realTy, [ty])
64              | Op.Normalize d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Normalize d => (Ty.vecTy d, [Ty.vecTy d])
# Line 92  Line 104 
104                  end                  end
105              | Op.TensorToWorldSpace(info, ty) => (ty, [Ty.ImageTy info, ty])              | Op.TensorToWorldSpace(info, ty) => (ty, [Ty.ImageTy info, ty])
106              | Op.EvalKernel(d, _, _) => (Ty.vecTy d, [Ty.vecTy d])              | Op.EvalKernel(d, _, _) => (Ty.vecTy d, [Ty.vecTy d])
107    (* DEPRECATED
108              | Op.LoadImage info => (Ty.ImageTy info, [Ty.StringTy])              | Op.LoadImage info => (Ty.ImageTy info, [Ty.StringTy])
109    *)
110              | Op.Inside(info, _) => (Ty.BoolTy, [Ty.vecTy(ImageInfo.dim info), Ty.ImageTy info])              | Op.Inside(info, _) => (Ty.BoolTy, [Ty.vecTy(ImageInfo.dim info), Ty.ImageTy info])
111              | Op.Input(ty, _, _) => (ty, [])              | Op.LoadSeq(ty, _) => (ty, [])
112              | Op.InputWithDefault(ty, _, _) => (ty, [ty])              | Op.LoadImage(ty, _, _) => (ty, [])
113                | Op.Input(Inputs.INP{ty, ...}) => (ty, [])
114              | Op.Print tys => (Ty.TupleTy[], tys)              | Op.Print tys => (Ty.TupleTy[], tys)
115              | _ => raise Fail("sigOf: invalid operator " ^ Op.toString rator)              | _ => raise Fail("sigOf: invalid operator " ^ Op.toString rator)
116            (* end case *))            (* end case *))

Legend:
Removed from v.1925  
changed lines
  Added in v.2027

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