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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/high-to-mid/probe.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/high-to-mid/probe.sml

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

revision 586, Wed Mar 9 20:33:32 2011 UTC revision 587, Wed Mar 9 20:34:26 2011 UTC
# Line 46  Line 46 
46            } (result, pdOp) = let            } (result, pdOp) = let
47            val vecsTy = DstTy.VecTy(2*s) (* vectors of coefficients cover support of kernel *)            val vecsTy = DstTy.VecTy(2*s) (* vectors of coefficients cover support of kernel *)
48            val vecDimTy = DstTy.VecTy dim            val vecDimTy = DstTy.VecTy dim
49          (* generate the variables that hold the convolution coefficients *)          (* generate the variables that hold the convolution coefficients.  The
50             * resulting list is in slowest-to-fastest axes order.
51             *)
52            val convCoeffs = let            val convCoeffs = let
53                  val Partials.D l = pdOp                  val Partials.D l = pdOp
54                  fun mkVar (_, []) = []                  fun mkVar (_, [], coeffs) = coeffs
55                    | mkVar (i, d::dd) = (case d                    | mkVar (i, d::dd, coeffs) = (case d
56                         of 0 => newVar_dim("h", i, vecsTy) :: mkVar(i+1, dd)                         of 0 => mkVar(i+1, dd, newVar_dim("h", i, vecsTy) :: coeffs)
57                          | 1 => newVar_dim("dh", i, vecsTy) :: mkVar(i+1, dd)                          | 1 => mkVar(i+1, dd, newVar_dim("dh", i, vecsTy) :: coeffs)
58                          | _ => newVar_dim(concat["d", Int.toString d, "h"], i, vecsTy) :: mkVar(i+1, dd)                          | _ => mkVar(i+1, dd, newVar_dim(concat["d", Int.toString d, "h"], i, vecsTy) :: coeffs)
59                        (* end case *))                        (* end case *))
60                  in                  in
61                    mkVar (0, l)                    mkVar (0, l, [])
62                  end                  end
63  val _ = print(concat["probeElem: ", Partials.partialToString pdOp, " in ", Int.toString(List.length convCoeffs), "D space\n"])  val _ = print(concat["probeElem: ", Partials.partialToString pdOp, " in ", Int.toString(List.length convCoeffs), "D space\n"])
64          (* for each dimension, we evaluate the kernel at the coordinates for that axis *)          (* for each dimension, we evaluate the kernel at the coordinates for that axis *)
# Line 108  Line 110 
110    
111    (* generate code for probing the field (D^k (v * h)) at pos *)    (* generate code for probing the field (D^k (v * h)) at pos *)
112      fun expand {result, img, v, h, k, pos} = let      fun expand {result, img, v, h, k, pos} = let
113    (* FIXME: only scalar images are supported! *)
114            val ImageInfo.ImgInfo{dim, ty=([], rTy), ...} = v            val ImageInfo.ImgInfo{dim, ty=([], rTy), ...} = v
115            val s = Kernel.support h            val s = Kernel.support h
116            val vecsTy = DstTy.VecTy(2*s) (* vectors of coefficients cover support of kernel *)            val vecsTy = DstTy.VecTy(2*s) (* vectors of coefficients cover support of kernel *)

Legend:
Removed from v.586  
changed lines
  Added in v.587

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