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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/cxx-util/cxx-names.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/cxx-util/cxx-names.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3888, Fri May 20 22:06:33 2016 UTC revision 3900, Mon May 23 15:20:24 2016 UTC
# Line 6  Line 6 
6   * All rights reserved.   * All rights reserved.
7   *)   *)
8    
9  structure RuntimeNames =  structure RuntimeNames : sig
   struct  
10    
11    (* Run-time system functions for images *)   (* the base type of the world struct *)
12      fun setImage dim = concat["Diderot::SetImage", Int.toString dim, "D"]      val worldBaseTyName : string
13      fun loadImage dim = concat["Diderot::LoadImage", Int.toString dim, "D"]  
14      fun freeImage dim = concat["Diderot::FreeImage", Int.toString dim, "D"]    (* the world type *)
15        val worldTyName : string
16        val worldPtrTy : CLang.ty
17    
18      (* the global variables struct *)
19        val globalTyName : string
20        val globalPtrTy : CLang.ty
21    
22      (* the pointer to the command-line options struct *)
23        val optionsPtrTy : CodeGenEnv.t -> CLang.ty
24    
25      (* Run-time system functions for dynamic sequences *)
26        val loadDynSeq : APITypes.t -> string
27        val loadDynSeqFromFile : APITypes.t -> string
28    
29      end = struct
30    
31        structure CL = CLang
32        structure Env = CodeGenEnv
33    
34      (* the base type of the world struct *)
35        val worldBaseTyName = "world_base"
36    
37      (* the world type *)
38        val worldTyName = "world"
39        val worldPtrTy = CL.T_Ptr(CL.T_Named worldTyName)
40    
41      (* the global variables struct *)
42        val globalTyName = "globals"
43        val globalPtrTy = CL.T_Ptr(CL.T_Named globalTyName)
44    
45      (* the pointer to the command-line options struct *)
46        fun optionsPtrTy env =
47              CL.T_Ptr(CL.T_Template("options", [Env.realTy env, Env.intTy env]))
48    
49    (* Run-time system functions for dynamic sequences *)    (* Run-time system functions for dynamic sequences *)
50  (* FIXME: should these be DynSeqLoad<ty>? *)  (* FIXME: should these be DynSeqLoad<ty>? *)
51      fun loadDynSeq ty = (case ty      fun loadDynSeq ty = (case ty
52             of APITypes.BoolTy => "Diderot::DynSeqLoadBool"             of APITypes.BoolTy => "diderot::DynSeqLoadBool"
53              | APITypes.IntTy => "Diderot::DynSeqLoadInt"              | APITypes.IntTy => "diderot::DynSeqLoadInt"
54              | APITypes.TensorTy _ => "Diderot::DynSeqLoadReal"              | APITypes.TensorTy _ => "diderot::DynSeqLoadReal"
55              | ty => raise Fail("unsupported sequence type " ^ APITypes.toString ty)              | ty => raise Fail("unsupported sequence type " ^ APITypes.toString ty)
56            (* end case *))            (* end case *))
57    
58      fun loadDynSeqFromFile ty = (case ty      fun loadDynSeqFromFile ty = (case ty
59             of APITypes.BoolTy => "Diderot::DynSeqLoadBoolFromFile"             of APITypes.BoolTy => "diderot::DynSeqLoadBoolFromFile"
60              | APITypes.IntTy => "Diderot::DynSeqLoadIntFromFile"              | APITypes.IntTy => "diderot::DynSeqLoadIntFromFile"
61              | APITypes.TensorTy _ => "Diderot::DynSeqLoadRealFromFile"              | APITypes.TensorTy _ => "diderot::DynSeqLoadRealFromFile"
62              | ty => raise Fail("unsupported sequence type " ^ APITypes.toString ty)              | ty => raise Fail("unsupported sequence type " ^ APITypes.toString ty)
63            (* end case *))            (* end case *))
64    

Legend:
Removed from v.3888  
changed lines
  Added in v.3900

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