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

SCM Repository

[diderot] Diff of /branches/charisee_dev/src/compiler/high-to-mid/ProbeEin.sml
ViewVC logotype

Diff of /branches/charisee_dev/src/compiler/high-to-mid/ProbeEin.sml

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

revision 3260, Wed Sep 23 16:09:21 2015 UTC revision 3261, Wed Sep 23 20:13:23 2015 UTC
# Line 281  Line 281 
281      *)      *)
282     fun expandEinOp( e as (y, DstIL.EINAPP(ein,args)),fieldset)=let     fun expandEinOp( e as (y, DstIL.EINAPP(ein,args)),fieldset)=let
283    
284          fun checkConst ([],a) = (*liftProbe a*) replaceProbe a          fun checkConst ([],a) = liftProbe a
285          | checkConst ((E.C _::_),a) = replaceProbe a          | checkConst ((E.C _::_),a) = replaceProbe a
286          | checkConst ((_ ::es),a)= checkConst(es,a)          | checkConst ((_ ::es),a)= checkConst(es,a)
287    
# Line 304  Line 304 
304    
305                  (*Probe that tensor at a constant position E.C c1*)                  (*Probe that tensor at a constant position E.C c1*)
306                  val param0 = [E.TEN(1,index1)]                  val param0 = [E.TEN(1,index1)]
307                  val body0 =  E.Tensor(0,[E.C c1]@dx)                  val nx=List.tabulate(length(dx)+1,fn n=>E.V n)
308                    val body0 =  E.Tensor(0,[E.C c1]@nx)
309                  val ein0 = mkEin(param0,index0,body0)                  val ein0 = mkEin(param0,index0,body0)
310                  val einApp0 = mkEinApp(ein0,[lhs1])                  val einApp0 = mkEinApp(ein0,[lhs1])
311                  val code0 = (y,einApp0)                  val code0 = (y,einApp0)
# Line 316  Line 317 
317          fun rewriteBody b=(case b          fun rewriteBody b=(case b
318              of E.Probe(E.Conv(_,_,_,[]),_)              of E.Probe(E.Conv(_,_,_,[]),_)
319                  => replaceProbe(0,e,b,[])                  => replaceProbe(0,e,b,[])
   
320              | E.Probe(E.Conv(_,[E.C _ ,E.V 0],_,[E.V 1]),pos)              | E.Probe(E.Conv(_,[E.C _ ,E.V 0],_,[E.V 1]),pos)
321                  => liftFieldMat (2,b)                  => liftFieldMat (2,b)
322              | E.Probe(E.Conv(_,[E.C _ ,E.V 0],_,[E.V 1,E.V 2] ),pos)              | E.Probe(E.Conv(_,[E.C _ ,E.V 0],_,[E.V 1,E.V 2] ),pos)
323                  => liftFieldMat (3,b)                  => liftFieldMat (3,b)
   
324              | E.Probe(E.Conv (_,alpha,_,dx),_)              | E.Probe(E.Conv (_,alpha,_,dx),_)
325                  => checkConst(dx,(0,e,b,[])) (*scans dx for contant*)                  => checkConst(dx,(0,e,b,[])) (*scans dx for contant*)
326              | E.Sum(sx,p as E.Probe(E.Conv(_,_,_,[]),_))              | E.Sum(sx,p as E.Probe(E.Conv(_,_,_,[]),_))

Legend:
Removed from v.3260  
changed lines
  Added in v.3261

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