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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3349 - (download) (annotate)
Tue Oct 27 15:16:36 2015 UTC (3 years, 9 months ago) by jhr
File size: 2332 byte(s)
making copyrights consistent for all code in the repository
(* runtime-names.sml
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * 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
    in

  (* names of generated types, functions, and globals *)
    val initGlobals = "Diderot_InitGlobals"	(* function for initializing program globals *)
    val registerOpts = "Diderot_RegisterGlobalOpts" (* function for registering command-line options *)
    val shutdown = "Diderot_Shutdown"		(* function that gets called at the end *)
    val initially = "Diderot_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 *)
    val statusTy = "Status_t"
    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"]
    val strandDescTy = "Strand_t"
    val worldTy = "Diderot_World_t"
    val optionsTy = "Diderot_Options_t"
    val allocInitially = "Diderot_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 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.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