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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1173 - (view) (download)

1 : jhr 1172 (* target-util.sml
2 :     *
3 :     * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     * 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 :     target : target, (* target platform *)
19 :     parallel : bool, (* parallel components *)
20 :     double : bool, (* true for double-precision candidates *)
21 :     debug : bool (* true if debugging of the target is enabled *)
22 :     }
23 :    
24 :     (* convert a target specification to the name of the runtime library *)
25 :     fun runtimeName {target, parallel, double, debug} = let
26 :     val l = if debug then ["-debug.o"] else [".o"]
27 :     val l = if parallel then "-par"::l else l
28 :     val p = if double then "-d" else "-f"
29 :     val t = (case target
30 :     of TARGET_C => "c"
31 :     | TARGET_CL => "cl"
32 :     | TARGET_CUDA => "cuda"
33 :     (* end case *))
34 :     in
35 : jhr 1173 OS.Path.concat(
36 :     Paths.diderotLib,
37 :     String.concat("diderot-rt-" :: t :: p :: l))
38 : jhr 1172 end
39 :    
40 :     end

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