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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3349 - (view) (download)

1 : jhr 1115 (* runtime-names.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 1115 * All rights reserved.
7 : jhr 1373 *
8 :     * These are names that are used in the common parts of the runtime system.
9 : jhr 1115 *)
10 :    
11 :     structure RuntimeNames =
12 :     struct
13 :    
14 :     local
15 :     structure Ty = TreeIL.Ty
16 :     in
17 :    
18 : jhr 1373 (* names of generated types, functions, and globals *)
19 : jhr 1115 val initGlobals = "Diderot_InitGlobals" (* function for initializing program globals *)
20 : jhr 1301 val registerOpts = "Diderot_RegisterGlobalOpts" (* function for registering command-line options *)
21 : jhr 1232 val shutdown = "Diderot_Shutdown" (* function that gets called at the end *)
22 : jhr 1115 val initially = "Diderot_Initially" (* function for creating initial strands *)
23 :     fun strandInit strand = strand ^ "_InitState"
24 :     fun strandTy strand = concat["Strand_", strand, "_t"]
25 :     fun strandDesc strand = concat["Strand_", strand]
26 :     val numStrands = "Diderot_NumStrands"
27 :     val strands = "Diderot_Strands"
28 :    
29 :     (* Diderot runtime system hooks *)
30 :     val statusTy = "Status_t"
31 : jhr 2636 fun setImage dim = concat["Diderot_SetImage", Int.toString dim, "D"]
32 : jhr 1115 fun loadImage dim = concat["Diderot_LoadImage", Int.toString dim, "D"]
33 : jhr 2636 fun freeImage dim = concat["Diderot_FreeImage", Int.toString dim, "D"]
34 : jhr 1115 val strandDescTy = "Strand_t"
35 :     val worldTy = "Diderot_World_t"
36 : jhr 1301 val optionsTy = "Diderot_Options_t"
37 : jhr 1115 val allocInitially = "Diderot_AllocInitially"
38 :     val inState = "Diderot_InState"
39 :    
40 : jhr 1640 (* Math utility functions *)
41 :     val evecs2x2 = "Diderot_evecs2x2"
42 :     val evecs3x3 = "Diderot_evecs3x3"
43 :     val evals2x2 = "Diderot_evals2x2"
44 :     val evals3x3 = "Diderot_evals3x3"
45 :    
46 : jhr 2636 (* functions for defining program inputs; note that images come from
47 :     * nrrd files, which are specified by their filenames.
48 :     *)
49 : jhr 1115 fun input ty = (case ty
50 : jhr 1373 of Ty.StringTy => "Diderot_OptAddString"
51 :     | Ty.BoolTy => "Diderot_OptAddBool"
52 : jhr 1640 | Ty.IntTy => "Diderot_OptAddInt"
53 : jhr 1373 | Ty.TensorTy[] => "Diderot_OptAddReal"
54 :     | Ty.TensorTy[2] => "Diderot_OptAddReal2"
55 :     | Ty.TensorTy[3] => "Diderot_OptAddReal3"
56 :     | Ty.TensorTy[4] => "Diderot_OptAddReal4"
57 : jhr 2636 | Ty.ImageTy _ => "Diderot_OptAddString"
58 :     | ty => raise Fail("unsupported input type " ^ Ty.toString ty)
59 : jhr 1115 (* end case *))
60 :    
61 :     end (* local *)
62 :     end

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