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

SCM Repository

[diderot] Annotation of /branches/vis12/src/compiler/c-util/runtime-names.sml
ViewVC logotype

Annotation of /branches/vis12/src/compiler/c-util/runtime-names.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1870 - (view) (download)

1 : jhr 1115 (* runtime-names.sml
2 :     *
3 :     * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     * All rights reserved.
5 : jhr 1373 *
6 :     * These are names that are used in the common parts of the runtime system.
7 : jhr 1115 *)
8 :    
9 :     structure RuntimeNames =
10 :     struct
11 :    
12 :     local
13 :     structure Ty = TreeIL.Ty
14 : jhr 1718 fun qualifyName name (tgt : TargetUtil.target_desc) = #namespace tgt ^ name
15 : jhr 1815 fun qualifyName' fixed (tgt : TargetUtil.target_desc, name) =
16 :     concat[#namespace tgt, fixed, "_", name]
17 : jhr 1115 in
18 :    
19 : jhr 1815 (* generated types *)
20 :     val worldTy = qualifyName "World_t"
21 :     val globalsTy = qualifyName "Globals_t"
22 :    
23 :     (* generate names for input and output variables *)
24 :     val inputDesc = qualifyName' "InVarDesc"
25 :     val inputGet = qualifyName' "InVarGet"
26 :     val inputSet = qualifyName' "InVarSet"
27 :     val inputSetByName = qualifyName' "InVarSetByName"
28 :     val outputGet = qualifyName' "OutputGet"
29 :    
30 : jhr 1373 (* names of generated types, functions, and globals *)
31 : jhr 1718 val initGlobals = "InitGlobals" (* function for initializing program globals *)
32 : nseltzer 1870 val freeGlobals = "FreeGlobals" (* function for freeing program globals *)
33 : jhr 1727 val initDefaults = "InitDefaults" (* function for initializing input defaults *)
34 :     val registerOpts = "RegisterGlobalOpts" (* function for registering command-line options *)
35 : jhr 1718 val shutdown = qualifyName "Shutdown" (* function that gets called at the end *)
36 :     val initially = qualifyName "Initially" (* function for creating initial strands *)
37 : jhr 1115 fun strandInit strand = strand ^ "_InitState"
38 :     fun strandTy strand = concat["Strand_", strand, "_t"]
39 :     fun strandDesc strand = concat["Strand_", strand]
40 :     val numStrands = "Diderot_NumStrands"
41 :     val strands = "Diderot_Strands"
42 :    
43 :     (* Diderot runtime system hooks *)
44 :     val statusTy = "Status_t"
45 : jhr 1807 fun setImage dim = concat["Diderot_SetImage", Int.toString dim, "D"]
46 : jhr 1115 fun loadImage dim = concat["Diderot_LoadImage", Int.toString dim, "D"]
47 : nseltzer 1870 fun freeImage dim = concat["Diderot_FreeImage", Int.toString dim, "D"]
48 : jhr 1115 val strandDescTy = "Strand_t"
49 : jhr 1718 val worldTy = qualifyName "World_t"
50 : jhr 1806 val globalTy = qualifyName "Globals_t"
51 : jhr 1301 val optionsTy = "Diderot_Options_t"
52 : jhr 1718 val allocInitially = "AllocInitially"
53 : jhr 1115 val inState = "Diderot_InState"
54 :    
55 : jhr 1640 (* Math utility functions *)
56 :     val evecs2x2 = "Diderot_evecs2x2"
57 :     val evecs3x3 = "Diderot_evecs3x3"
58 :     val evals2x2 = "Diderot_evals2x2"
59 :     val evals3x3 = "Diderot_evals3x3"
60 :    
61 : jhr 1373 (* functions for defining program inputs *)
62 : jhr 1115 fun input ty = (case ty
63 : jhr 1373 of Ty.StringTy => "Diderot_OptAddString"
64 :     | Ty.BoolTy => "Diderot_OptAddBool"
65 : jhr 1640 | Ty.IntTy => "Diderot_OptAddInt"
66 : jhr 1373 | Ty.TensorTy[] => "Diderot_OptAddReal"
67 :     | Ty.TensorTy[2] => "Diderot_OptAddReal2"
68 :     | Ty.TensorTy[3] => "Diderot_OptAddReal3"
69 :     | Ty.TensorTy[4] => "Diderot_OptAddReal4"
70 : jhr 1115 | ty => raise Fail("unsupported input type " ^ Ty.toString ty)
71 :     (* end case *))
72 :    
73 :     end (* local *)
74 :     end

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