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

SCM Repository

[diderot] Annotation of /branches/lamont/src/compiler/codegen/target-util.sml
ViewVC logotype

Annotation of /branches/lamont/src/compiler/codegen/target-util.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1704 - (view) (download)
Original Path: branches/vis12/src/compiler/codegen/target-util.sml

1 : jhr 1232 (* target-util.sml
2 :     *
3 : jhr 1704 * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 : jhr 1232 * All rights reserved.
5 :     *
6 :     * Utility support for target selection, etc.
7 :     *)
8 :    
9 :     structure TargetUtil =
10 :     struct
11 :    
12 :     datatype target
13 :     = TARGET_C (* C code *)
14 :     | TARGET_CL (* C + OpenCL *)
15 :     | TARGET_CUDA (* C + CUDA *)
16 :    
17 :     type target_desc = {
18 : jhr 1704 exec : bool, (* generate standalone executable? *)
19 : jhr 1232 target : target, (* target platform *)
20 :     parallel : bool, (* parallel components *)
21 :     double : bool, (* true for double-precision candidates *)
22 :     debug : bool (* true if debugging of the target is enabled *)
23 :     }
24 :    
25 :     (* convert a target specification to the name of the runtime library *)
26 : jhr 1704 fun runtimeName {exec, target, parallel, double, debug} = let
27 : jhr 1232 val l = if debug then ["-debug.o"] else [".o"]
28 :     val l = if parallel then "-par"::l else l
29 :     val p = if double then "-d" else "-f"
30 :     val t = (case target
31 : jhr 1704 of TARGET_C => "-c"
32 :     | TARGET_CL => "-cl"
33 :     | TARGET_CUDA => "-cuda"
34 : jhr 1232 (* end case *))
35 : jhr 1704 val lib = if exec then "-main" else "-rt"
36 : jhr 1232 in
37 :     OS.Path.concat(
38 :     Paths.diderotLib,
39 : jhr 1704 String.concat("diderot" :: lib :: t :: p :: l))
40 : jhr 1232 end
41 :    
42 :     end

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