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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/mid-to-low/ein-to-vector.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/mid-to-low/ein-to-vector.sml

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

revision 3703, Thu Mar 31 12:59:00 2016 UTC revision 3704, Thu Mar 31 22:05:40 2016 UTC
# Line 37  Line 37 
37    (* vector sum of a sequence of vectors *)    (* vector sum of a sequence of vectors *)
38      val addV : AvailRHS.t * index_env * param * param list -> LowIR.var      val addV : AvailRHS.t * index_env * param * param list -> LowIR.var
39    
40      (* vector dot product *)
41        val dotV : AvailRHS.t * index_env * param * param -> LowIR.var
42    
43    (* generic binary operations on vectors *)    (* generic binary operations on vectors *)
44      val binopV : LowOps.rator * int -> AvailRHS.t * index_env * (param * param) -> LowIR.var      val binopV : LowOps.rator * int -> AvailRHS.t * index_env * (param * param) -> LowIR.var
45    
# Line 100  Line 103 
103            Mk.reduce (avail, fn (avail, u, v) => Mk.vecAdd(avail, dim, u, v), u::vs)            Mk.reduce (avail, fn (avail, u, v) => Mk.vecAdd(avail, dim, u, v), u::vs)
104          end          end
105    
106      (* dot product of two vectors *)
107        fun dotV (avail, mapp, u, v) = let
108              val u = paramToVar (avail, mapp, u)
109              val v = paramToVar (avail, mapp, v)
110              val ty as Ty.TensorTy[dim] = IR.Var.ty u
111              val prod = AvailRHS.addAssign (avail, "mulV", ty, IR.OP(Op.VMul dim, [u, v]));
112              in
113                AvailRHS.addAssign (avail, "sumV", Ty.realTy, IR.OP(Op.VSum dim, [prod]))
114              end
115    
116    (* TODO:    (* TODO:
    * dotV  
117     * sumDotV     * sumDotV
118     *)     *)
119    

Legend:
Removed from v.3703  
changed lines
  Added in v.3704

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