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/cl-target.sml
ViewVC logotype

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

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

revision 1706, Wed Mar 7 12:06:48 2012 UTC revision 1713, Fri Mar 9 21:37:19 2012 UTC
# Line 693  Line 693 
693    
694          fun genSrc (baseName, prog) = let          fun genSrc (baseName, prog) = let
695                val Prog{                val Prog{
696                        tgt={srcFile, double, ...},                        tgt,
697                        globals, topDecls, strands, initially,                        globals, topDecls, strands, initially,
698                        imgGlobals, numDims,outFn, ...                        imgGlobals, numDims,outFn, ...
699                      } = prog                      } = prog
# Line 713  Line 713 
713                  clppDecl (CL.verbatim [HF.text] [                  clppDecl (CL.verbatim [HF.text] [
714                      ("OUTFILE", clFileName),                      ("OUTFILE", clFileName),
715                      ("SRCFILE", OS.Path.joinBaseExt{base=baseName, ext=SOME "diderot"}),                      ("SRCFILE", OS.Path.joinBaseExt{base=baseName, ext=SOME "diderot"}),
716                      ("PRECISION", if double then "DOUBLE" else "SINGLE")                      ("DIDEROT_FLOAT_PRECISION", TargetUtil.floatPrecisionDef tgt),
717                        ("DIDEROT_INT_PRECISION", TargetUtil.intPrecisionDef tgt)
718                    ]);                    ]);
719                (* if there are no globals, then define a dummy type *)                (* if there are no globals, then define a dummy type *)
720                  if List.null(!globals)                  if List.null(!globals)
# Line 735  Line 736 
736                  clppDecl (genUpdateMethod(strand, globals, imgGlobals));                  clppDecl (genUpdateMethod(strand, globals, imgGlobals));
737                (* Generate the Host C file *)                (* Generate the Host C file *)
738                  cppDecl (CL.D_Verbatim[                  cppDecl (CL.D_Verbatim[
739                      if double                      concat["#define " ^ TargetUtil.floatPrecisionDef tgt, "\n"],
740                        then "#define DIDEROT_DOUBLE_PRECISION\n"                      concat["#define " ^ TargetUtil.intPrecisionDef tgt, "\n"],
741                        else "#define DIDEROT_SINGLE_PRECISION\n",                      concat["#define " ^ TargetUtil.targetDef tgt, "\n"],
                     "#define DIDEROT_INT\n",  
                     "#define DIDEROT_TARGET_CL\n",  
742                      "#include \"Diderot/diderot.h\"\n"                      "#include \"Diderot/diderot.h\"\n"
743                    ]);                    ]);
744                  case !globals                  case !globals
# Line 747  Line 746 
746                    | _ => ()                    | _ => ()
747                  (* end case *);                  (* end case *);
748                  cppDecl (CL.D_Var(["static"], CL.charPtr, "ProgramName",                  cppDecl (CL.D_Var(["static"], CL.charPtr, "ProgramName",
749                    SOME(CL.I_Exp(CL.mkStr srcFile))));                    SOME(CL.I_Exp(CL.mkStr(#srcFile tgt)))));
750                  cppDecl (genGlobalStruct (#hostTy, !globals, RN.globalsTy));                  cppDecl (genGlobalStruct (#hostTy, !globals, RN.globalsTy));
751                  cppDecl (genGlobalStruct (#shadowTy, !globals, RN.shadowGlobalsTy));                  cppDecl (genGlobalStruct (#shadowTy, !globals, RN.shadowGlobalsTy));
752  (* FIXME: does this really need to be a global? *)  (* FIXME: does this really need to be a global? *)

Legend:
Removed from v.1706  
changed lines
  Added in v.1713

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