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 2867, Tue Feb 10 06:52:58 2015 UTC revision 2870, Wed Feb 25 21:47:43 2015 UTC
# Line 160  Line 160 
160          val (dx,newsx1,Ps)=transformToIndexSpace(freshIndex,dim,dx,Pid)          val (dx,newsx1,Ps)=transformToIndexSpace(freshIndex,dim,dx,Pid)
161          val params'=params@[E.TEN(3,[dim]),E.TEN(1,[dim]),E.TEN(1,[dim,dim])]          val params'=params@[E.TEN(3,[dim]),E.TEN(1,[dim]),E.TEN(1,[dim,dim])]
162          val body' = createBody(dim, s,freshIndex+nshift,alpha,dx,Vid, hid, nid, fid)          val body' = createBody(dim, s,freshIndex+nshift,alpha,dx,Vid, hid, nid, fid)
163          val body' =formBody(E.Sum(newsx1, E.Prod([body']@Ps)))  
164            (*silly change in order of product to match vis branch WorldtoSpace functions*)
165            val body' =(case Ps
166                of [_,_,_]=>        formBody(E.Sum(newsx1, E.Prod(Ps@[body'])))
167                | _ =>  formBody(E.Sum(newsx1, E.Prod([body']@Ps)))
168                (*end case*))
169          val args'=argsA@[PArg]          val args'=argsA@[PArg]
170          in          in
171              (body',params',args' ,code)              (body',params',args' ,code)
# Line 170  Line 175 
175      *Looks to see if the expression has a probe. If so, replaces it.      *Looks to see if the expression has a probe. If so, replaces it.
176      * Note how we keeps eps expressions so only generate pieces that are used      * Note how we keeps eps expressions so only generate pieces that are used
177      *)      *)
178      fun expandEinOp( e as (y, DstIL.EINAPP(Ein.EIN{params, index, body}, args))) = let      fun expandEinOp( e as (y, DstIL.EINAPP(ein as Ein.EIN{params, index, body}, args))) = let
         fun printResult code=testp["\nINSIDE PROBEEIN","\nbody",  
                 MidToS.printEINAPP e, "\n=>\n",  
                 (String.concatWith",\t"(List.map MidToS.printEINAPP code))]  
179          fun rewriteBody b=(case b          fun rewriteBody b=(case b
180              of E.Probe(E.Field _,_)=> raise Fail"Poorly formed EIN operator. Argument needs to be applied in High-IL"              of E.Probe(E.Field _,_)=> raise Fail"Poorly formed EIN operator. Argument needs to be applied in High-IL"
181              | E.Probe e =>let              | E.Probe e =>let
182    
183                  val (body',params',args',newbies)=replaceProbe(E.Probe e,params,args, index, [])                  val (body',params',args',newbies)=replaceProbe(E.Probe e,params,args, index, [])
184                  val einapp=(y,DstIL.EINAPP(Ein.EIN{params=params', index=index, body=body'},args'))                  val einapp=(y,DstIL.EINAPP(Ein.EIN{params=params', index=index, body=body'},args'))
185                  val code=newbies@[einapp]                  val code=newbies@[einapp]
186    
187                  in                  in
188                      code                      code
189                  end                  end
190              | E.Sum(sx,E.Probe e)  =>let              | E.Sum(sx,E.Probe e)  =>let
191    
192                  val (body',params',args',newbies)=replaceProbe(E.Probe e,params,args, index, sx)                  val (body',params',args',newbies)=replaceProbe(E.Probe e,params,args, index, sx)
193                  val  body'=E.Sum(sx,body')                  val  body'=E.Sum(sx,body')
194                  val einapp=(y,DstIL.EINAPP(Ein.EIN{params=params', index=index, body=body'},args'))                  val einapp=(y,DstIL.EINAPP(Ein.EIN{params=params', index=index, body=body'},args'))
195                  val code=newbies@[einapp]                  val code=newbies@[einapp]
196    
197                  in                  in
198                      code                      code
199                  end                  end
200              | E.Sum(sx,E.Prod[eps,E.Probe e]) =>let              | E.Sum(sx,E.Prod[eps,E.Probe e]) =>let
201    
202                  val (body',params',args',newbies)=replaceProbe(E.Probe e,params,args, index, sx)                  val (body',params',args',newbies)=replaceProbe(E.Probe e,params,args, index, sx)
203                  val  body'=E.Sum(sx,E.Prod[eps,body'])                  val  body'=E.Sum(sx,E.Prod[eps,body'])
204                  val einapp=(y,DstIL.EINAPP(Ein.EIN{params=params', index=index, body=body'},args'))                  val einapp=(y,DstIL.EINAPP(Ein.EIN{params=params', index=index, body=body'},args'))

Legend:
Removed from v.2867  
changed lines
  Added in v.2870

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