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

SCM Repository

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

Annotation of /trunk/src/compiler/codegen/target-util.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3349 - (view) (download)

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

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