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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/c-target/c-target.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/c-target/c-target.sml

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

revision 2869, Thu Feb 12 16:14:22 2015 UTC revision 2870, Wed Feb 25 21:47:43 2015 UTC
# Line 120  Line 120 
120        | getSmallest 2 =1        | getSmallest 2 =1
121       | getSmallest _ =2       | getSmallest _ =2
122    
123    (* Enables vec6
124    
125        (*isHwVec: int->bool
126        * Can this vector size be supported with one piece,
127        *)
128        fun isHwVec width=
129        if(width>6) then false else true
130    
131        (*isVectTy:int-> bool
132        *is vector int supported with Diderot_Vec
133        *)
134        fun isVecTy 1 =true
135        | isVecTy 2 =true
136        | isVecTy 4 =true
137        | isVecTy 6 =true (*just added*)
138        | isVecTy _= false
139    
140        fun getLargest 1 =1
141          | getLargest 2 =2
142          | getLargest 3 =2
143          | getLargest 4 =4
144          | getLargest 5 =4
145          | getLargest 6 =6
146          | getLargest _ =6
147    
148    
149        fun getSmallest 1 =1
150          | getSmallest 2 =1
151          | getSmallest 3 =2
152          | getSmallest 4 =2
153          | getSmallest 5 =4
154          | getSmallest 6 =5
155          | getSmallest _ =6
156    *)
157      (* getPieces:int->int list      (* getPieces:int->int list
158      * Breaks vector operation of  size n into HW supported pieces      * Breaks vector operation of  size n into HW supported pieces
159      * 6->[4,2]      * 6->[4,2]
# Line 140  Line 174 
174      *Pieces-vector operation broken up into piece sizes      *Pieces-vector operation broken up into piece sizes
175      *)      *)
176      fun getVecTy n= let      fun getVecTy n= let
177            (*val _ =print ("\n\n  getVecTy-"^Int.toString(n))*)
178          (*Looks for next largest length supported*)          (*Looks for next largest length supported*)
179          fun fillVec vn =(case (isVecTy vn)          fun fillVec vn =(case (isVecTy vn)
180              of true => (true,vn,[vn])              of true => (true,vn,[vn])
# Line 374  Line 409 
409                          ]                          ]
410                      val prArgs = (case outTy                      val prArgs = (case outTy
411                             of Ty.IntTy => [CL.E_Str(!N.gIntFormat ^ "\n"), outState]                             of Ty.IntTy => [CL.E_Str(!N.gIntFormat ^ "\n"), outState]
412                              | Ty.TensorTy[] => [CL.E_Str "%7.8f\n", outState]                              | Ty.TensorTy[] => [CL.E_Str "%f\n", outState]
413                              | Ty.TensorTy alpha=>let                              | Ty.TensorTy alpha=>let
414                                  (*Assumes Tensor can be printed as an array*)                                  (*Assumes Tensor can be printed as an array*)
415                                  fun size n=foldl (fn (a,b) => b*a) 1 n                                  fun size n=foldl (fn (a,b) => b*a) 1 n
416                                  val d=(size alpha)                                  val d=(size alpha)
417                                  (*used 7.8 percision here to match vis branch*)                                  (*used 7.8 percision here to match vis branch*)
418                                  val fmt = CL.E_Str(                                  val fmt = CL.E_Str(
419                                        String.concatWith " " (List.tabulate(d, fn _ => "%7.8f"))                                        String.concatWith " " (List.tabulate(d, fn _ => "%f"))
420                                        ^ "\n")                                        ^ "\n")
421                                  val args = List.tabulate (d, fn i => ToC.prntArr(outState, i))                                  val args = List.tabulate (d, fn i => ToC.prntArr(outState, i))
422                                  in                                  in

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

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