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

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/compiler/cl-target/gen-output.sml
ViewVC logotype

Diff of /branches/vis12-cl/src/compiler/cl-target/gen-output.sml

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

revision 2742, Sat Sep 27 23:33:58 2014 UTC revision 2743, Sun Sep 28 02:54:54 2014 UTC
# Line 51  Line 51 
51      structure V = IL.Var      structure V = IL.Var
52      structure Ty = IL.Ty      structure Ty = IL.Ty
53      structure CL = CLang      structure CL = CLang
54      structure N = CNames      structure RN = RuntimeNames
55      structure Nrrd = NrrdEnums      structure Nrrd = NrrdEnums
56      structure U = CLUtil      structure U = CLUtil
57    
# Line 64  Line 64 
64    
65      val nrrdPtrTy = CL.T_Ptr(CL.T_Named "Nrrd")      val nrrdPtrTy = CL.T_Ptr(CL.T_Named "Nrrd")
66      val sizeTy = CL.T_Named "size_t"      val sizeTy = CL.T_Named "size_t"
67      fun wrldPtr tgt = CL.T_Ptr(CL.T_Named(N.worldTy tgt))      fun wrldPtr tgt = CL.T_Ptr(CL.T_Named(RN.worldTy tgt))
68        fun globPtr tgt = CL.T_Ptr(CL.T_Named(CLNames.globalsTy tgt))
69      fun mkInt i = CL.mkInt(IntInf.fromInt i)      fun mkInt i = CL.mkInt(IntInf.fromInt i)
70    
71    (* variables in the generated code *)    (* variables in the generated code *)
# Line 88  Line 89 
89            val body = CL.mkBlock[]  (* FIXME *)            val body = CL.mkBlock[]  (* FIXME *)
90            in            in
91              U.mkKernel(              U.mkKernel(
92                name,                name ^ "Kern",
93                [U.globalParam(wrldPtr tgt, "wrld"), U.globalParam(CL.T_Ptr ty', "outBuf")],                [U.globalParam(globPtr tgt, "glob"), U.globalParam(CL.T_Ptr ty', "outBuf")],
94                body)                body)
95            end            end
96    
# Line 145  Line 146 
146      fun gen (tgt : Properties.props, nAxes) = let      fun gen (tgt : Properties.props, nAxes) = let
147            fun getFn snapshot (ty, name) = let            fun getFn snapshot (ty, name) = let
148                  val funcName = if snapshot                  val funcName = if snapshot
149                        then N.snapshotGet(tgt, name)                        then RN.snapshotGet(tgt, name)
150                        else N.outputGet(tgt, name)                        else RN.outputGet(tgt, name)
151                  fun mkFunc (params, body) =                  fun mkFunc (params, body) =
152                        CL.D_Func([], CL.boolTy, funcName, CL.PARAM([], wrldPtr tgt, "wrld")::params, body)                        CL.D_Func([], CL.boolTy, funcName, CL.PARAM([], wrldPtr tgt, "wrld")::params, body)
153                  in                  in

Legend:
Removed from v.2742  
changed lines
  Added in v.2743

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