SCM Repository
View of /branches/vis12/src/compiler/c-util/runtime-names.sml
Parent Directory
|
Revision Log
Revision 2779 -
(download)
(annotate)
Tue Oct 14 13:50:20 2014 UTC (6 years, 4 months ago) by jhr
File size: 4137 byte(s)
Tue Oct 14 13:50:20 2014 UTC (6 years, 4 months ago) by jhr
File size: 4137 byte(s)
get rid of redundant name (globalTy) for globalsTy in code generator
(* runtime-names.sml * * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu) * All rights reserved. * * These are names that are used in the common parts of the runtime system. *) structure RuntimeNames = struct local structure Ty = TreeIL.Ty fun qualifyName name (tgt : Properties.props) = #namespace tgt ^ name fun qualifyName' fixed (tgt : Properties.props, name) = concat[#namespace tgt, fixed, "_", name] in (* generated types *) val worldTy = qualifyName "World_t" val globalsTy = qualifyName "Globals_t" val inputsTy = qualifyName "Inputs_t" (* type of struct used to hold command-line *) (* inputs. *) val definedInpTy = qualifyName "DefinedInputs_t" (* type of struct used to hold command-line *) (* inputs. *) (* generate names for input and output variables *) val inputDesc = qualifyName' "InVarDesc" val inputGet = qualifyName' "InVarGet" val inputSet = qualifyName' "InVarSet" val inputSetByName = qualifyName' "InVarSetByName" val outputGet = qualifyName' "OutputGet" val snapshotGet = qualifyName' "Snapshot" (* names of generated types, functions, and globals *) val initGlobals = "InitGlobals" (* function for initializing program globals *) val freeGlobals = "FreeGlobals" (* function for freeing program globals *) val initDefaults = "InitDefaults" (* function for initializing input defaults *) val registerOpts = "RegisterGlobalOpts" (* function for registering command-line options *) val initInputs = "InitInputs" (* function for initializing global inputs *) val initDefined = qualifyName "InitDefined" (* function for initializing input-defined flags *) val checkDefined = qualifyName "ChkDefined" (* function for initializing input-defined flags *) val shutdown = qualifyName "Shutdown" (* function that gets called at the end *) val initially = qualifyName "Initially" (* function for creating initial strands *) fun strandInit strand = strand ^ "_InitState" fun strandTy strand = concat["Strand_", strand, "_t"] fun strandDesc strand = concat["Strand_", strand] val numStrands = "Diderot_NumStrands" val strands = "Diderot_Strands" (* Diderot runtime system hooks *) fun setImage dim = concat["Diderot_SetImage", Int.toString dim, "D"] fun loadImage dim = concat["Diderot_LoadImage", Int.toString dim, "D"] fun freeImage dim = concat["Diderot_FreeImage", Int.toString dim, "D"] fun loadDynSeq ty = (case ty of Ty.BoolTy => "Diderot_DynSeqLoadBool" | Ty.IntTy => "Diderot_DynSeqLoadInt" | Ty.TensorTy _ => "Diderot_DynSeqLoadReal" | ty => raise Fail("unsupported sequence type " ^ Ty.toString ty) (* end case *)) fun loadDynSeqFromFile ty = (case ty of Ty.BoolTy => "Diderot_DynSeqLoadBoolFromFile" | Ty.IntTy => "Diderot_DynSeqLoadIntFromFile" | Ty.TensorTy _ => "Diderot_DynSeqLoadRealFromFile" | ty => raise Fail("unsupported sequence type " ^ Ty.toString ty) (* end case *)) val strandDescTy = "Strand_t" val optionsTy = "Diderot_Options_t" val allocInitially = "AllocInitially" val inState = "Diderot_InState" (* Math utility functions *) val evecs2x2 = "Diderot_evecs2x2" val evecs3x3 = "Diderot_evecs3x3" val evals2x2 = "Diderot_evals2x2" val evals3x3 = "Diderot_evals3x3" (* functions for defining program inputs; note that sequences and images come from * nrrd files, which are specified by their filenames. *) fun input ty = (case ty of Ty.StringTy => "Diderot_OptAddString" | Ty.BoolTy => "Diderot_OptAddBool" | Ty.IntTy => "Diderot_OptAddInt" | Ty.TensorTy[] => "Diderot_OptAddReal" | Ty.TensorTy[2] => "Diderot_OptAddReal2" | Ty.TensorTy[3] => "Diderot_OptAddReal3" | Ty.TensorTy[4] => "Diderot_OptAddReal4" | Ty.DynSeqTy _ => "Diderot_OptAddString" | Ty.ImageTy _ => "Diderot_OptAddString" | ty => raise Fail("unsupported input type " ^ Ty.toString ty) (* end case *)) end (* local *) end
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |