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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/cl-target/runtime-names.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/cl-target/runtime-names.sml

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

revision 1272, Mon Jun 6 09:19:11 2011 UTC revision 1273, Mon Jun 6 10:46:20 2011 UTC
# Line 19  Line 19 
19      val gVectorWid = ref 4      val gVectorWid = ref 4
20      val gIntTy = ref CLang.int32      val gIntTy = ref CLang.int32
21      val gRealTy = ref CLang.float      val gRealTy = ref CLang.float
22        val gRealStem = ref "?"
23      val gRealSuffix = ref "?"      val gRealSuffix = ref "?"
24      val gIntSuffix = ref "?"      val gIntSuffix = ref "?"
25      val gIntFormat = ref "?"      val gIntFormat = ref "?"
# Line 31  Line 32 
32                gVectorWid := 2;                gVectorWid := 2;
33                gIntTy := CLang.int64;                gIntTy := CLang.int64;
34                gRealTy := CLang.double;                gRealTy := CLang.double;
35                  gRealStem := "double";
36                gRealSuffix := "d";                gRealSuffix := "d";
37                gIntSuffix := "l";                gIntSuffix := "l";
38                gIntFormat := "%ld")                gIntFormat := "%ld")
# Line 38  Line 40 
40                gVectorWid := 4;                gVectorWid := 4;
41                gIntTy := CLang.int32;                gIntTy := CLang.int32;
42                gRealTy := CLang.float;                gRealTy := CLang.float;
43                  gRealStem := "float";
44                gRealSuffix := "f";                gRealSuffix := "f";
45                gIntSuffix := "i";                gIntSuffix := "i";
46                gIntFormat := "%d"))                gIntFormat := "%d"))
# Line 52  Line 55 
55      fun addTySuffix (stem, 1) = stem ^ !gRealSuffix      fun addTySuffix (stem, 1) = stem ^ !gRealSuffix
56        | addTySuffix (stem, n) = addVecSuffix stem n        | addTySuffix (stem, n) = addVecSuffix stem n
57    
58      fun vecTy n = concat["vec", Int.toString n, !gRealSuffix, "_t"]      fun vecTy n = concat[!gRealStem, Int.toString n]
59      fun ivecTy n = concat["vec", Int.toString n, !gIntSuffix, "_t"]      fun ivecTy n = concat["int", Int.toString n]
60      fun imageTy n = concat["Diderot_image", Int.toString n, "D_t"]      fun imageTy n = concat["Diderot_image", Int.toString n, "D_t"]
61      fun matTy (n, m) = concat["Diderot_Mat", Int.toString n, "x", Int.toString m, "_t"]      fun matTy (n, m) = concat["Diderot_Mat", Int.toString n, "x", Int.toString m, "_t"]
62    
# Line 78  Line 81 
81      val globalsVarNameCL = "cl_diderotGlobals"      val globalsVarNameCL = "cl_diderotGlobals"
82      val setupFName = "Diderot_GPU_Init"      val setupFName = "Diderot_GPU_Init"
83    (* scalar math functions *)    (* scalar math functions *)
84      fun max () = addRealSuffix "max"      val max = "max"
85      fun min () = addRealSuffix "min"      val min = "min"
86      fun fabs () = addRealSuffix "fabs"      val fabs = "fabs"
87    
88    (* lerp *)    (* lerp *)
89      fun lerp n = addTySuffix("lerp", n)      val lerp = "mix"
90    
91    (* vector math functions *)    (* vector math functions *)
92      val mkVec = addVecSuffix "vec"      fun mkVec 3 = "VEC3" (* for OpenCL 1.0 *)
93      val scale = addVecSuffix "scale"        | mkVec n = concat["(", !gRealStem, Int.toString n, ")"]  (* cast syntax *)
94      val truncToInt = addVecSuffix "truncToInt"      val truncToInt = addVecSuffix "truncToInt"
95      val dot = addVecSuffix "dot"      val dot = "dot"
96      fun cross () = addVecSuffix "cross" 3      val cross = "cross"
97      val length = addVecSuffix "length"      val length = "length"
98      val normalize = addVecSuffix "normalize"      val normalize = "normalize"
99      fun vecitof n = concat["vec", Int.toString n, "ito", !gRealSuffix]      fun vecitof n = concat["vec", Int.toString n, "ito", !gRealSuffix]
100      fun vecftoi n = concat["vec", Int.toString n, !gRealSuffix, "toi"]      fun vecftoi n = concat["vec", Int.toString n, !gRealSuffix, "toi"]
101    

Legend:
Removed from v.1272  
changed lines
  Added in v.1273

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