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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/low-to-tree/low-to-tree.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/low-to-tree/low-to-tree.sml

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

revision 4066, Tue Jun 28 01:20:01 2016 UTC revision 4067, Tue Jun 28 01:23:19 2016 UTC
# Line 123  Line 123 
123              | _ => e              | _ => e
124           (* end case *))           (* end case *))
125    
126      (* turn an expression of type TensorRefTy to one of TensorRef *)
127        fun mkDeref e = (case TreeTypeOf.exp e
128               of TTy.TensorRefTy(shp as _::_) => T.E_Op(TOp.TensorCopy shp, [e])
129                | _ => e
130             (* end case *))
131    
132      fun cvtScalarTy Ty.BoolTy = TTy.BoolTy      fun cvtScalarTy Ty.BoolTy = TTy.BoolTy
133        | cvtScalarTy Ty.IntTy = TTy.IntTy        | cvtScalarTy Ty.IntTy = TTy.IntTy
134        | cvtScalarTy (Ty.TensorTy[]) = TTy.realTy        | cvtScalarTy (Ty.TensorTy[]) = TTy.realTy
# Line 581  Line 587 
587                | IR.SEQ(args, ty) => let                | IR.SEQ(args, ty) => let
588                    val (es, stms) = singleArgs (env, args)                    val (es, stms) = singleArgs (env, args)
589                    val ty = U.trType ty                    val ty = U.trType ty
590                    (* if we are dealing with a sequence of tensors, then we need to copy references *)
591                      val es = (case ty
592                             of TTy.SeqTy(TTy.TensorTy _, _) => List.map mkDeref es
593                              | _ => es
594                            (* end case *))
595                    in                    in
596                      Env.bindVar (env, getLHS (), Env.RHS(ty, T.E_Seq(es, ty)));                      Env.bindVar (env, getLHS (), Env.RHS(ty, T.E_Seq(es, ty)));
597                      stms                      stms

Legend:
Removed from v.4066  
changed lines
  Added in v.4067

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