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 3563, Sun Jan 10 17:01:58 2016 UTC revision 3576, Tue Jan 12 17:45:05 2016 UTC
# Line 22  Line 22 
22            val (tshape, sizes, body) = CleanIndex.clean (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 y = V.new (concat[name, "_l_", Int.toString id], Ty.TensorTy sizes)
26            val (y, IR.EINAPP(ein, args)) = cleanParams(M, body, Rparams, sizes, argsOrig@[M])            val IR.EINAPP(ein, args) = CleanParams.clean (body, Rparams, sizes, argsOrig@[y])
27          (* shift indices in probe body from constant to variable *)          (* shift indices in probe body from constant to variable *)
28            val Ein.EIN{            val Ein.EIN{
29                    body=E.Probe(E.Conv(V, [c1], h, dx), pos),                    body=E.Probe(E.Conv(V, [c1], h, dx), pos),
# Line 36  Line 36 
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, [])
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 = E.EIN{params = params0, index = index0, body = body1}
40            val lhs2 = AvailRHS.addAssign avail (lhs1, mkEinApp(ein1, args))            val lhs2 = AvailRHS.addAssign avail (lhs1, IR.EINAPP(ein1, args))
41            val Rargs = argsOrig @ [lhs2]            val Rargs = argsOrig @ [lhs2]
42          (*Probe that tensor at a constant position  c1*)          (*Probe that tensor at a constant position  c1*)
43            val nx = List.mapi (fn (i, _) => E.V i) dx            val nx = List.mapi (fn (i, _) => E.V i) dx
# Line 58  Line 58 
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.clean (M, body, Rparams, sizes, args @ [M])            val einapp = CleanParams.clean (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.clean (y, body', params', index, args')            val einapp = CleanParams.clean (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.3563  
changed lines
  Added in v.3576

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