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 3094, Wed Mar 18 04:45:43 2015 UTC revision 3095, Wed Mar 18 13:12:57 2015 UTC
# Line 53  Line 53 
53      structure V = IL.Var      structure V = IL.Var
54      structure Ty = IL.Ty      structure Ty = IL.Ty
55      structure CL = CLang      structure CL = CLang
     structure RN = RuntimeNames  
56      structure Nrrd = NrrdEnums      structure Nrrd = NrrdEnums
57      structure U = CLUtil      structure U = CLUtil
58        structure CN = CNames
59    
60      fun mapi f l = let      fun mapi f l = let
61            fun mapf (i, [], l) = List.rev l            fun mapf (i, [], l) = List.rev l
# Line 66  Line 66 
66    
67      val nrrdPtrTy = CL.T_Ptr(CL.T_Named "Nrrd")      val nrrdPtrTy = CL.T_Ptr(CL.T_Named "Nrrd")
68      val sizeTy = CL.T_Named "size_t"      val sizeTy = CL.T_Named "size_t"
     fun globPtr tgt = CL.T_Ptr(CL.T_Named(CLNames.globalsTy tgt))  
     fun schedPtr tgt = CL.T_Ptr(CL.T_Named(CLNames.schedTy 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 112  Line 110 
110            val kName = name ^ "Kern"            val kName = name ^ "Kern"
111            val kern = U.mkKernel(            val kern = U.mkKernel(
112                  kName,                  kName,
113                  [U.globalParam(schedPtr tgt, "sched"), U.globalParam(CL.T_Ptr ty', "outBuf"), U.clParam(CL.uint32, "nStrands")],                  [U.globalParam(CN.schedPtrTy tgt, "sched"), U.globalParam(CL.T_Ptr ty', "outBuf"), U.clParam(CL.uint32, "nStrands")],
114                  body)                  body)
115            in            in
116              (kName, kern)              (kName, kern)
# Line 169  Line 167 
167      fun gen (tgt : Properties.props, nAxes) = let      fun gen (tgt : Properties.props, nAxes) = let
168            fun getFn snapshot (ty, name) = let            fun getFn snapshot (ty, name) = let
169                  val funcName = if snapshot                  val funcName = if snapshot
170                        then RN.snapshotGet(tgt, name)                        then CN.snapshotGet(tgt, name)
171                        else RN.outputGet(tgt, name)                        else CN.outputGet(tgt, name)
172                  fun mkFunc (params, body) =                  fun mkFunc (params, body) =
173                        CL.D_Func([], CL.boolTy, funcName, CL.PARAM([], N.worldPtrTy tgt, "wrld")::params, body)                        CL.D_Func([], CL.boolTy, funcName, CL.PARAM([], CN.worldPtrTy tgt, "wrld")::params, body)
174                  in                  in
175                    case ty                    case ty
176                     of Ty.DynSeqTy ty' => raise Fail "dynamic sequences not supported for OpenCL"                     of Ty.DynSeqTy ty' => raise Fail "dynamic sequences not supported for OpenCL"

Legend:
Removed from v.3094  
changed lines
  Added in v.3095

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