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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/einTest/testExpandConv.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/einTest/testExpandConv.sml

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

revision 2495, Wed Oct 23 21:28:25 2013 UTC revision 2496, Tue Oct 29 05:29:46 2013 UTC
# Line 18  Line 18 
18    
19  (*3-d Scalar Field*)  (*3-d Scalar Field*)
20  val s0 = ("3-d scalar Field ",E.EIN{  val s0 = ("3-d scalar Field ",E.EIN{
21      params = [E.FLD 3,E.TEN],      params = [E.FLD 3,E.TEN,E.TEN],
22      index = [E.IX 3],      index = [E.IX 3],
23      body= E.Probe(E.Conv(E.Field(0,[]),[]),E.Tensor(1,[E.V 0]))      body= E.Probe(E.Conv(0,[],1,[]),E.Tensor(1,[E.V 0]))
24  })  })
25    
26    
# Line 28  Line 28 
28  val v0 = ("3-d Vector Field ",E.EIN{  val v0 = ("3-d Vector Field ",E.EIN{
29      params = [E.FLD 3],      params = [E.FLD 3],
30      index = [E.IX 2, E.IX 3],      index = [E.IX 2, E.IX 3],
31      body= E.Probe(E.Conv(E.Field(0,[E.V 0]),[]),E.Tensor(1,[E.V 1]))      body= E.Probe(E.Conv(0,[E.V 0],1,[]),E.Tensor(1,[E.V 1]))
32  })  })
33    
34    
# Line 36  Line 36 
36  val v1 = ("grad  3-d Vector Field ",E.EIN{  val v1 = ("grad  3-d Vector Field ",E.EIN{
37      params = [E.FLD 3],      params = [E.FLD 3],
38      index = [E.IX 2,E.IX 3,E.IX 3],      index = [E.IX 2,E.IX 3,E.IX 3],
39      body= E.Probe(E.Conv(E.Field(0,[E.V 0]),[E.V 1]),E.Tensor(1,[E.V 2]))      body= E.Probe(E.Conv(0,[E.V 0],1,[E.V 1]),E.Tensor(1,[E.V 2]))
40  })  })
41    
42  (*grad  2-d Scalar Field*)  (*grad  2-d Scalar Field*)
43  val s1 = ("grad  2-d Scalar Field ",E.EIN{  val s1 = ("grad  2-d Scalar Field ",E.EIN{
44      params = [E.FLD 2, E.TEN],      params = [E.FLD 2, E.TEN],
45      index = [E.IX 2,E.IX 2],      index = [E.IX 2,E.IX 2],
46      body= E.Probe(E.Conv(E.Field(0,[]),[E.V 0]),E.Tensor(1,[E.V 1]))      body= E.Probe(E.Conv(0,[],1,[E.V 0]),E.Tensor(1,[E.V 1]))
47  })  })
48    
49  (*Hessian 3-d Vector Field*)  (*Hessian 3-d Vector Field*)
50  val v2 = ("Hessian 3-d Vector Field",E.EIN{  val v2 = ("Hessian 3-d Vector Field",E.EIN{
51      params = [E.FLD 3],      params = [E.FLD 3],
52      index = [E.IX 2,E.IX 3, E.IX 3,E.IX 3],      index = [E.IX 2,E.IX 3, E.IX 3,E.IX 3],
53      body= E.Probe(E.Conv(E.Field(0,[E.V 0]),[E.V 1,E.V 2]),E.Tensor(1,[E.V 3]))      body= E.Probe(E.Conv(0,[E.V 0],1,[E.V 1,E.V 2]),E.Tensor(1,[E.V 3]))
54      })      })
55    
56  (*Hessian 3-d Scalar Field*)  (*Hessian 3-d Scalar Field*)
57  val s2 = ("Hessian 3-d Scalar Field",E.EIN{  val s2 = ("Hessian 3-d Scalar Field",E.EIN{
58      params = [E.FLD 3,E.TEN ],      params = [E.FLD 3,E.TEN ],
59      index = [E.IX 3, E.IX 3,E.IX 3],      index = [E.IX 3, E.IX 3,E.IX 3],
60      body= E.Probe(E.Conv(E.Field(0,[]),[E.V 0,E.V 1]), E.Tensor(1,[E.V 2]))      body= E.Probe(E.Conv(0,[],1,[E.V 0,E.V 1]), E.Tensor(1,[E.V 2]))
61  })  })
62    
63    
64  (*  (*
65  fun test(a,e)=(print a; (P.printerE e); print "=> \t"; (P.printerE(ExpandConv.expand(e)));print"\n")  fun test(a,e)=(print a; (P.printerE e); print "=> \t"; (P.printerE(ExpandConv.expand(e)));print"\n")
   
 (*)val u=List.map test[v0,v1,v2]*)  
66  *)  *)
67    
68    
69    
70  val s = E.EIN{  val s = E.EIN{
71      params = [E.FLD 3, E.TEN,E.FLD 3],      params = [E.FLD 3, E.TEN,E.FLD 3],
72      index = [E.IX 3,E.IX 3],      index = [E.IX 3,E.IX 3],
73      body= E.Sub(E.Probe(E.Conv(E.Field(0,[E.V 0]),[]),E.Tensor(1,[E.V 1])),      body= E.Sub(E.Probe(E.Conv(0,[E.V 0],1,[]),E.Tensor(1,[E.V 1])),
74              E.Probe(E.Conv(E.Field(2,[E.V 0]),[]),E.Tensor(1,[E.V 1])))              E.Probe(E.Conv(2,[E.V 0],1,[]),E.Tensor(1,[E.V 1])))
75  }  }
76    
77    
78  val s2 = E.EIN{  val s2 = E.EIN{
79      params = [E.FLD 2, E.TEN,E.FLD 2,E.FLD 2],      params = [E.FLD 2, E.TEN,E.FLD 2,E.FLD 2],
80      index = [E.IX 3,E.IX 2],      index = [E.IX 3,E.IX 2],
81      body= E.Sub(E.Probe(E.Conv(E.Field(3,[E.V 0]),[]),E.Tensor(1,[E.V 1])),      body= E.Sub(E.Probe(E.Conv(3,[E.V 0],1,[]),E.Tensor(1,[E.V 1])),
82          E.Sub(E.Probe(E.Conv(E.Field(0,[E.V 0]),[]),E.Tensor(1,[E.V 1])),          E.Sub(E.Probe(E.Conv(0,[E.V 0],1,[]),E.Tensor(1,[E.V 1])),
83          E.Probe(E.Conv(E.Field(2,[E.V 0]),[]),E.Tensor(1,[E.V 1])))          E.Probe(E.Conv(2,[E.V 0],1,[]),E.Tensor(1,[E.V 1])))
84      )      )
85  }  }
86    
# Line 88  Line 88 
88  val s3 = E.EIN{  val s3 = E.EIN{
89      params = [E.FLD 2, E.TEN,E.FLD 2,E.FLD 2,E.TEN],      params = [E.FLD 2, E.TEN,E.FLD 2,E.FLD 2,E.TEN],
90      index = [E.IX 3,E.IX 2],      index = [E.IX 3,E.IX 2],
91      body= E.Sub(E.Probe(E.Conv(E.Field(3,[E.V 0]),[]),E.Tensor(4,[E.V 1])),      body= E.Sub(E.Probe(E.Conv(3,[E.V 0],1,[]),E.Tensor(4,[E.V 1])),
92          E.Sub(E.Probe(E.Conv(E.Field(0,[E.V 0]),[]),E.Tensor(1,[E.V 1])),          E.Sub(E.Probe(E.Conv(0,[E.V 0],1,[]),E.Tensor(1,[E.V 1])),
93          E.Probe(E.Conv(E.Field(2,[E.V 0]),[]),E.Tensor(1,[E.V 1]))))          E.Probe(E.Conv(2,[E.V 0],1,[]),E.Tensor(1,[E.V 1]))   ))
94      }      }
95    
96    
97  val s4 = E.EIN{  val s4 = E.EIN{
98      params = [E.FLD 2, E.TEN,E.FLD 2,E.FLD 2,E.TEN],      params = [E.FLD 2, E.TEN,E.FLD 2,E.FLD 2,E.TEN],
99      index = [E.IX 3,E.IX 2],      index = [E.IX 3,E.IX 2],
100      body= E.Add[E.Probe(E.Conv(E.Field(3,[E.V 0]),[]),E.Tensor(4,[E.V 1])),      body= E.Add[E.Probe(E.Conv(3,[E.V 0],1,[]),E.Tensor(4,[E.V 1])),
101          E.Add[E.Probe(E.Conv(E.Field(0,[E.V 0]),[]),E.Tensor(1,[E.V 1])),          E.Add[E.Probe(E.Conv(0,[E.V 0],1,[]),E.Tensor(1,[E.V 1])),
102          E.Probe(E.Conv(E.Field(2,[E.V 0]),[]),E.Tensor(1,[E.V 1]))]]          E.Probe(E.Conv(2,[E.V 0],1,[]),E.Tensor(1,[E.V 1]))]]
103  }  }
104    
105    
106    val s5=E.EIN{
107    params = [E.FLD 3],
108    index = [E.IX 2,E.IX 3, E.IX 3,E.IX 3],
109    body= E.Probe(E.Conv(0,[E.V 0],1,[E.V 1,E.V 2]),E.Tensor(1,[E.V 3]))
110    }
111  fun test2(e)=((P.printerE e); print "=> \t"; (P.printerE(ExpandConv.expandEinOp(e,[])));print"\n")  fun test2(e)=((P.printerE e); print "=> \t"; (P.printerE(ExpandConv.expandEinOp(e,[])));print"\n")
112    
113  (*  (*
114  val u1=List.map test2[s2,s3,s4]  val u1=List.map test2[s2,s3,s4,s5]
 *)  
115    
116    *)
117    
118    end; (* local *)    end; (* local *)
119    

Legend:
Removed from v.2495  
changed lines
  Added in v.2496

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