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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/options/options.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/options/options.sml

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

revision 3811, Wed May 4 01:14:18 2016 UTC revision 3812, Wed May 4 13:16:31 2016 UTC
# Line 18  Line 18 
18              help : bool option,         (* "-h" and "--help" ==> SOME false; "-H" ==> SOME true. *)              help : bool option,         (* "-h" and "--help" ==> SOME false; "-H" ==> SOME true. *)
19              version : bool,             (* "--version" specified? *)              version : bool,             (* "--version" specified? *)
20              defs : string list,         (* input-variable definitions *)              defs : string list,         (* input-variable definitions *)
21              target : Target.desc,       (* collected infromation about the target *)              target : TargetOptions.t,   (* collected infromation about the target *)
22              file : string               (* source file *)              file : string               (* source file *)
23            }            }
24    
# Line 31  Line 31 
31    
32      structure G = GetOpt      structure G = GetOpt
33      structure P = OS.Path      structure P = OS.Path
34        structure Tgt = TargetOptions
35    
36      exception Usage of string      exception Usage of string
37    
# Line 44  Line 45 
45      val standaloneFlg = ref false      val standaloneFlg = ref false
46      val snapshotFlg = ref false      val snapshotFlg = ref false
47      val prefix : string option ref = ref NONE      val prefix : string option ref = ref NONE
48      val target = ref Target.SEQUENTIAL      val platform = ref Tgt.SEQUENTIAL
49      val bspFlg = ref false      val bspFlg = ref false
50    
51    (* package a boolean control as a GetOpt option descriptor (NoArg) *)    (* package a boolean control as a GetOpt option descriptor (NoArg) *)
# Line 72  Line 73 
73        val desc = "  parallel   -- generate parallel code" :: desc        val desc = "  parallel   -- generate parallel code" :: desc
74        val desc = "  sequential -- generate sequential code (default)" :: desc        val desc = "  sequential -- generate sequential code (default)" :: desc
75        val desc = "specify the target platform:" :: desc        val desc = "specify the target platform:" :: desc
76        fun parseTargetOpt "c" = (target := Target.SEQUENTIAL)        fun parseTargetOpt "c" = (platform := Tgt.SEQUENTIAL)
77          | parseTargetOpt "sequential" = (target := Target.SEQUENTIAL)          | parseTargetOpt "sequential" = (platform := Tgt.SEQUENTIAL)
78          | parseTargetOpt "parallel" = (target := Target.PARALLEL)          | parseTargetOpt "parallel" = (platform := Tgt.PARALLEL)
79          | parseTargetOpt "pthread" = (target := Target.PARALLEL)          | parseTargetOpt "pthread" = (platform := Tgt.PARALLEL)
80          | parseTargetOpt "cl" = if Paths.clEnabled          | parseTargetOpt "cl" = if Paths.clEnabled
81              then (target := Target.OPENCL)              then (platform := Tgt.OPENCL)
82              else raise Usage "cl target not supported by this version"              else raise Usage "cl target not supported by this version"
83          | parseTargetOpt "opencl" = if Paths.clEnabled          | parseTargetOpt "opencl" = if Paths.clEnabled
84              then (target := Target.OPENCL)              then (platform := Tgt.OPENCL)
85              else raise Usage "cl target not supported by this version"              else raise Usage "cl target not supported by this version"
86          | parseTargetOpt "cuda" = if Paths.cudaEnabled          | parseTargetOpt "cuda" = if Paths.cudaEnabled
87              then (target := Target.CUDA)              then (platform := Tgt.CUDA)
88              else raise Usage "cuda target not supported by this version"              else raise Usage "cuda target not supported by this version"
89          | parseTargetOpt opt = raise Usage(concat["unrecognized target \"", opt, "\""])          | parseTargetOpt opt = raise Usage(concat["unrecognized target \"", opt, "\""])
90      in      in
# Line 199  Line 200 
200                        end                        end
201                  (* end case *))                  (* end case *))
202          (* figure out target details *)          (* figure out target details *)
203            val targetDesc : Target.desc = {            val targetDesc : Tgt.t = {
                   version = Version.message,  
204                    srcFile = srcFile,                    srcFile = srcFile,
205                    outDir = outDir,                    outDir = outDir,
206                    outBase = outBase,                    outBase = outBase,
207                    exec = !standaloneFlg,                    exec = !standaloneFlg,
208                    snapshot = not(!standaloneFlg) andalso !snapshotFlg,                    snapshot = not(!standaloneFlg) andalso !snapshotFlg,
209                    target = !target,                    platform = !platform,
210                    namespace = Option.getOpt(!prefix, "Diderot")^"_",                    namespace = Option.getOpt(!prefix, "Diderot"),
211                    double = !doubleFlg,                    double = !doubleFlg,
212                    longint = false,              (* currently always false *)                    longint = false,              (* currently always false *)
213                    debug = !debugFlg,                    debug = !debugFlg,

Legend:
Removed from v.3811  
changed lines
  Added in v.3812

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