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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/cl-target/cl-target.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/cl-target/cl-target.sml

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

revision 1313, Sat Jun 11 16:57:31 2011 UTC revision 1314, Sat Jun 11 17:02:26 2011 UTC
# Line 461  Line 461 
461                val clGlobalBuffers = getGlobalDataBuffers(!imgGlobals, "context", errVar)                val clGlobalBuffers = getGlobalDataBuffers(!imgGlobals, "context", errVar)
462                val clGlobalArguments = genGlobalArguments(!imgGlobals, "argStart", "kernel", errVar)                val clGlobalArguments = genGlobalArguments(!imgGlobals, "argStart", "kernel", errVar)
463              (* Body put all the statments together *)              (* Body put all the statments together *)
464                val body = CL.mkDecl(clIntTy, errVar, SOME(CL.I_Exp(CL.mkInt(0, CL.intTy))))                val body = CL.mkDecl(clIntTy, errVar, SOME(CL.I_Exp(CL.mkInt 0)))
465                      :: clGlobalBuffers @ clGlobalArguments                      :: clGlobalBuffers @ clGlobalArguments
466                in                in
467  (* FIXME: we ought to check the error condition! *)  (* FIXME: we ought to check the error condition! *)
# Line 505  Line 505 
505                      ] @ genKeneralGlobalParams(!imgGlobals)                      ] @ genKeneralGlobalParams(!imgGlobals)
506                val thread_ids = if nDims = 1                val thread_ids = if nDims = 1
507                      then [                      then [
508                          CL.mkDecl(CL.intTy, "x", SOME(CL.I_Exp(CL.mkInt(0, CL.intTy)))),                          CL.mkDecl(CL.intTy, "x", SOME(CL.I_Exp(CL.mkInt 0))),
509                          CL.mkAssign(CL.mkVar "x",CL.mkApply(RN.getGlobalThreadId,[CL.mkInt(0,CL.intTy)]))                          CL.mkAssign(CL.mkVar "x",CL.mkApply(RN.getGlobalThreadId,[CL.mkInt 0]))
510                        ]                        ]
511                      else [                      else [
512                          CL.mkDecl(CL.intTy, "x", SOME(CL.I_Exp(CL.mkInt(0, CL.intTy)))),                          CL.mkDecl(CL.intTy, "x", SOME(CL.I_Exp(CL.mkInt 0))),
513                          CL.mkDecl(CL.intTy, "y", SOME(CL.I_Exp(CL.mkInt(0, CL.intTy)))),                          CL.mkDecl(CL.intTy, "y", SOME(CL.I_Exp(CL.mkInt 0))),
514                          CL.mkAssign(CL.mkVar "x",  CL.mkApply(RN.getGlobalThreadId,[CL.mkInt(0,CL.intTy)])),                          CL.mkAssign(CL.mkVar "x",  CL.mkApply(RN.getGlobalThreadId,[CL.mkInt 0])),
515                          CL.mkAssign(CL.mkVar "y",CL.mkApply(RN.getGlobalThreadId,[CL.mkInt(1,CL.intTy)]))                          CL.mkAssign(CL.mkVar "y",CL.mkApply(RN.getGlobalThreadId,[CL.mkInt 1]))
516                        ]                        ]
517                val strandDecl = [                val strandDecl = [
518                      CL.mkDecl(CL.T_Named tyName, inState, NONE),                      CL.mkDecl(CL.T_Named tyName, inState, NONE),
# Line 528  Line 528 
528                          CL.mkAssign(CL.mkVar inState, CL.mkSubscript(CL.mkVar "selfIn",index)),                          CL.mkAssign(CL.mkVar inState, CL.mkSubscript(CL.mkVar "selfIn",index)),
529                          CL.mkAssign(CL.mkVar outState,CL.mkSubscript(CL.mkVar "selfOut",index))                          CL.mkAssign(CL.mkVar outState,CL.mkSubscript(CL.mkVar "selfOut",index))
530                        ] end                        ] end
531                val status = CL.mkDecl(CL.intTy, "status", SOME(CL.I_Exp(CL.mkInt(0, CL.intTy))))                val status = CL.mkDecl(CL.intTy, "status", SOME(CL.I_Exp(CL.mkInt 0)))
532                val local_vars = thread_ids @ initKernelGlobals(!globals,!imgGlobals)  @ strandDecl @ strandObjects @ [status]                val local_vars = thread_ids @ initKernelGlobals(!globals,!imgGlobals)  @ strandDecl @ strandObjects @ [status]
533                val while_exp = CL.mkBinOp(                val while_exp = CL.mkBinOp(
534                      CL.mkBinOp(CL.mkVar "status",CL.#!=, CL.mkVar RN.kStabilize),                      CL.mkBinOp(CL.mkVar "status",CL.#!=, CL.mkVar RN.kStabilize),

Legend:
Removed from v.1313  
changed lines
  Added in v.1314

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