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

SCM Repository

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

Diff of /branches/vis12/src/compiler/cl-target/tree-to-cl.sml

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

revision 2006, Fri Oct 5 11:57:14 2012 UTC revision 2007, Fri Oct 5 13:02:17 2012 UTC
# Line 396  Line 396 
396                      trBlk(env, elseBlk))]                      trBlk(env, elseBlk))]
397                | IL.S_New _ => raise Fail "new not supported yet" (* FIXME *)                | IL.S_New _ => raise Fail "new not supported yet" (* FIXME *)
398                | IL.S_Save([x], exp) => trSet (env, trLHSStateVar x, exp)                | IL.S_Save([x], exp) => trSet (env, trLHSStateVar x, exp)
399  (* FIXME: I think that S_LoadImage should never happen in OpenCL code [jhr] *)                | IL.S_Input _ => raise Fail "impossible S_Input in OpenCL"
400                | IL.S_LoadImage(lhs, dim, name) => checkSts (fn sts => let                | IL.S_InputImage _ => raise Fail "impossible S_Input in OpenCL"
401                    val lhs = lookup(env, lhs)                | IL.S_InputSeq _ => raise Fail "impossible S_Input in OpenCL"
                   val name = trExp(env, name)  
                   val imgTy = CL.T_Named(RN.imageTy dim)  
                   val loadFn = RN.loadImage dim  
                   in [  
                     CL.mkDeclInit(  
                       CL.T_Named RN.statusTy, sts,  
                       CL.E_Apply(loadFn, [name, CL.mkUnOp(CL.%&, CL.E_Var lhs)]))  
                   ] end)  
 (* FIXME: I think that S_Input should never happen in OpenCL code [jhr] *)  
            | IL.S_Input(lhs, name, desc, optDflt) => checkSts (fn sts => let  
                   val inputFn = RN.input(V.ty lhs)  
                   val lhs = lookup(env, lhs)  
                   val (initCode, hasDflt) = (case optDflt  
                      of SOME e => ([CL.mkAssign(CL.E_Var lhs, trExp(env, e))], true)  
                       | NONE => ([], false)  
                     (* end case *))  
                   val code = [  
                       CL.mkDeclInit(  
                         CL.T_Named RN.statusTy, sts,  
                         CL.E_Apply(inputFn, [  
                             CL.mkStr name,  
                             CL.mkUnOp(CL.%&, CL.mkIndirect(CL.mkVar RN.globalsVarName, lhs)),  
                             CL.mkBool hasDflt  
                           ]))  
                     ]  
                   in  
                     initCode @ code  
                   end)  
402                | IL.S_Exit args => [CL.mkReturn NONE]                | IL.S_Exit args => [CL.mkReturn NONE]
403                | IL.S_Active => [CL.mkReturn(SOME(CL.mkVar RN.kActive))]                | IL.S_Active => [CL.mkReturn(SOME(CL.mkVar RN.kActive))]
404                | IL.S_Stabilize => [CL.mkReturn(SOME(CL.mkVar RN.kStabilize))]                | IL.S_Stabilize => [CL.mkReturn(SOME(CL.mkVar RN.kStabilize))]

Legend:
Removed from v.2006  
changed lines
  Added in v.2007

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