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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/high-to-mid/float-ein.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/high-to-mid/float-ein.sml

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

revision 3658, Thu Feb 4 19:59:56 2016 UTC revision 3659, Thu Feb 4 20:30:06 2016 UTC
# Line 35  Line 35 
35            val unshiftedBody = E.Probe(E.Conv(V, [E.V newvx], h, dx), pos)            val unshiftedBody = E.Probe(E.Conv(V, [E.V newvx], h, dx), pos)
36          (* clean to get body indices in order *)          (* clean to get body indices in order *)
37            val (_ , _, body1) = CleanIndex.clean (unshiftedBody, index1, [])            val (_ , _, body1) = CleanIndex.clean (unshiftedBody, index1, [])
           val lhs1 = V.new ("L", Ty.TensorTy index1)  
38            val ein1 = E.EIN{params = params0, index = index0, body = body1}            val ein1 = E.EIN{params = params0, index = index0, body = body1}
39            val lhs2 = AvailRHS.addAssign avail (lhs1, IR.EINAPP(ein1, args))            val lhs = AvailRHS.addAssign (avail, "L", Ty.TensorTy index1, IR.EINAPP(ein1, args))
40            val Rargs = argsOrig @ [lhs2]            val Rargs = argsOrig @ [lhs]
41          (*Probe that tensor at a constant position  c1*)          (*Probe that tensor at a constant position  c1*)
42            val nx = List.mapi (fn (i, _) => E.V i) dx            val nx = List.mapi (fn (i, _) => E.V i) dx
43            val Re = E.Tensor(id, c1 :: tshape)            val Re = E.Tensor(id, c1 :: tshape)
# Line 55  Line 54 
54      fun lift (name, e, params, index, sx, args, avail) = let      fun lift (name, e, params, index, sx, args, avail) = let
55            val (tshape, sizes, body) = CleanIndex.clean(e, index, sx)            val (tshape, sizes, body) = CleanIndex.clean(e, index, sx)
56            val id = length params            val id = length params
           val Rparams = params @ [E.TEN(true, sizes)]  
57            val Re = E.Tensor(id, tshape)            val Re = E.Tensor(id, tshape)
           val M = V.new (concat[name, "_l_", Int.toString id], Ty.TensorTy sizes)  
58            val  einapp = CleanParams.clean(body, params, sizes, args)            val  einapp = CleanParams.clean(body, params, sizes, args)
59            val var = AvailRHS.addAssign avail (M, einapp)            val lhs = AvailRHS.addAssign (
60            val Rargs = args @ [var]                  avail,
61                    concat[name, "_l_", Int.toString id], Ty.TensorTy sizes,
62                    CleanParams.clean (body, params, sizes, args))
63            in            in
64              (Re, Rparams, Rargs)              (Re, params @ [E.TEN(true, sizes)], args @ [lhs])
65            end            end
66    
67      fun isOp e = (case e      fun isOp e = (case e

Legend:
Removed from v.3658  
changed lines
  Added in v.3659

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