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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/mid-to-low/step2.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/mid-to-low/step2.sml

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

revision 2675, Sat Jul 19 20:57:06 2014 UTC revision 2676, Wed Jul 23 02:43:37 2014 UTC
# Line 35  Line 35 
35    
36    
37  val Sca=DstTy.TensorTy([])  val Sca=DstTy.TensorTy([])
38    val addR=DstOp.addSca
39    
40    
41  fun mkProdSca rest=S3.aaV(DstOp.prodSca,rest,"prodSca",Sca)  fun mkProdSca rest=S3.aaV(DstOp.prodSca,rest,"prodSca",Sca)
42  fun mkSubSca rest= S3.aaV(DstOp.subSca,rest,"subSca",Sca)  fun mkSubSca rest= S3.aaV(DstOp.subSca,rest,"subSca",Sca)
43  fun mkDivSca rest= S3.aaV(DstOp.divSca,rest,"divSca",Sca)  fun mkDivSca rest= S3.aaV(DstOp.divSca,rest,"divSca",Sca)
# Line 204  Line 207 
207              of ([],code)=>let val (vA,A)=mkInt 0 in (vA,A) end              of ([],code)=>let val (vA,A)=mkInt 0 in (vA,A) end
208              | ([id1],code) => (id1,code)              | ([id1],code) => (id1,code)
209              | (ids,code)    => let              | (ids,code)    => let
210                  val (vB,B)= mkMultipleSca(ids,DstOp.addSca)                  val (vB,B)= mkMultipleSca(ids,addR)
211                  in (vB,code@B) end                  in (vB,code@B) end
212              (*end case*))              (*end case*))
213    
# Line 241  Line 244 
244                      in (vD, A@B@D) end                      in (vD, A@B@D) end
245                  (*end case*))                  (*end case*))
246              end              end
247          | E.Add e               => (iterList(AddcheckO(e,[],[]),DstOp.addSca))          | E.Add e               => (iterList(AddcheckO(e,[],[]),addR))
248          | E.Prod e              => iterList(ProdcheckO(e,[],[]),DstOp.prodSca)          | E.Prod e              => iterList(ProdcheckO(e,[],[]),DstOp.prodSca)
249          | E.Sum(sx,E.Prod(E.Img (Vid,_,_)::E.Krn(Hid,del,pos)::es))=>let          | E.Sum(sx,E.Prod(E.Img (Vid,_,_)::E.Krn(Hid,del,pos)::es))=>let
250              val harg=List.nth(origargs,Hid)              val harg=List.nth(origargs,Hid)
# Line 252  Line 255 
255                  genKrn.evalField(!mapp,(body,v,h,info))                  genKrn.evalField(!mapp,(body,v,h,info))
256              end              end
257    
258          | E.Sum(sumx, e)=>iterList(Sumcheck(sumx,e),DstOp.addSca)          | E.Sum(sumx, e)=>iterList(Sumcheck(sumx,e),addR)
259          (*end case*))          (*end case*))
260          end          end
261    

Legend:
Removed from v.2675  
changed lines
  Added in v.2676

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