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 3562, Sun Jan 10 16:56:09 2016 UTC revision 3563, Sun Jan 10 17:01:58 2016 UTC
# Line 19  Line 19 
19    
20      fun cut (name, origProbe, params, index, sx, argsOrig, avail, newvx) = let      fun cut (name, origProbe, params, index, sx, argsOrig, avail, newvx) = let
21          (*clean and rewrite current body*)          (*clean and rewrite current body*)
22            val (tshape, sizes, body) = cleanIndex (origProbe, index, sx)            val (tshape, sizes, body) = CleanIndex.clean (origProbe, index, sx)
23            val id = length params            val id = length params
24            val Rparams = params@[E.TEN(true, sizes)]            val Rparams = params@[E.TEN(true, sizes)]
25            val M = V.new (concat[name, "_l_", Int.toString id], Ty.TensorTy sizes)            val M = V.new (concat[name, "_l_", Int.toString id], Ty.TensorTy sizes)
# Line 34  Line 34 
34            val index1 = index0@[3]            val index1 = index0@[3]
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.cleanIndex (unshiftedBody, index1, [])            val (_ , _, body1) = CleanIndex.clean (unshiftedBody, index1, [])
38            val lhs1 = V.new ("L", Ty.TensorTy index1)            val lhs1 = V.new ("L", Ty.TensorTy index1)
39            val ein1 = mkEin(params0, index1, body1)            val ein1 = mkEin(params0, index1, body1)
40            val lhs2 = AvailRHS.addAssign avail (lhs1, mkEinApp(ein1, args))            val lhs2 = AvailRHS.addAssign avail (lhs1, mkEinApp(ein1, args))
# Line 53  Line 53 
53      *creates new param and replacement tensor for the original ein_exp      *creates new param and replacement tensor for the original ein_exp
54      *)      *)
55      fun lift (name, e, params, index, sx, args, avail) = let      fun lift (name, e, params, index, sx, args, avail) = let
56            val (tshape, sizes, body) = cleanIndex(e, index, sx)            val (tshape, sizes, body) = CleanIndex.clean(e, index, sx)
57            val id = length params            val id = length params
58            val Rparams = params @ [E.TEN(true, sizes)]            val Rparams = params @ [E.TEN(true, sizes)]
59            val Re = E.Tensor(id, tshape)            val Re = E.Tensor(id, tshape)
60            val M = V.new (concat[name, "_l_", Int.toString id], Ty.TensorTy sizes)            val M = V.new (concat[name, "_l_", Int.toString id], Ty.TensorTy sizes)
61            val (_, einapp) = cleanParams (M, body, Rparams, sizes, args @ [M])            val (_, einapp) = CleanParams.clean (M, body, Rparams, sizes, args @ [M])
62            val var = AvailRHS.addAssign avail (M, einapp)            val var = AvailRHS.addAssign avail (M, einapp)
63            val Rargs = args @ [var]            val Rargs = args @ [var]
64            in            in
# Line 137  Line 137 
137                    | _ => (exp, params, args)                    | _ => (exp, params, args)
138                  (* end case *))                  (* end case *))
139            val (body', params', args') = rewrite ([], body, params, args)            val (body', params', args') = rewrite ([], body, params, args)
140            val einapp = cleanParams (y, body', params', index, args')            val einapp = CleanParams.clean (y, body', params', index, args')
141            in            in
142              List.rev (IR.ASSGN(y, einapp) :: AvailRHS.getAssignments avail)              List.rev (IR.ASSGN(y, einapp) :: AvailRHS.getAssignments avail)
143            end            end

Legend:
Removed from v.3562  
changed lines
  Added in v.3563

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