SCM Repository
View of /branches/vis15/src/compiler/common/api-types.sml
Parent Directory
|
Revision Log
Revision 3931 -
(download)
(annotate)
Sun Jun 5 14:13:21 2016 UTC (3 years, 6 months ago) by jhr
File size: 1146 byte(s)
Sun Jun 5 14:13:21 2016 UTC (3 years, 6 months ago) by jhr
File size: 1146 byte(s)
working on merge: code generation
(* api-types.sml * * A representation of the types of values that can be communicated to and from a * Diderot program. * * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu) * * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved. *) structure APITypes = struct datatype t = IntTy | BoolTy | TensorTy of int list | StringTy | ImageTy of int * int list | SeqTy of t * int option val realTy = TensorTy[] fun toString IntTy = "int" | toString BoolTy = "bool" | toString (TensorTy[]) = "real" | toString (TensorTy[2]) = "vec2" | toString (TensorTy[3]) = "vec3" | toString (TensorTy[4]) = "vec4" | toString (TensorTy dd) = concat["tensor[", String.concatWithMap "," Int.toString dd, "]"] | toString StringTy = "string" | toString (ImageTy(d, dd)) = concat[ "image(", Int.toString d, ")[", String.concatWithMap "," Int.toString dd, "]" ] | toString (SeqTy(ty, NONE)) = toString ty ^ "[]" | toString (SeqTy(ty, SOME d)) = concat[toString ty, "[", Int.toString d, "]"] end
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |