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

SCM Repository

[diderot] Annotation of /branches/vis12-cl/src/compiler/cl-target/ocl-names.sml
ViewVC logotype

Annotation of /branches/vis12-cl/src/compiler/cl-target/ocl-names.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3125 - (view) (download)

1 : jhr 3095 (* ocl-names.sml
2 : jhr 2403 *
3 : jhr 3088 * COPYRIGHT (c) 2015 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 : jhr 2403 * All rights reserved.
5 : jhr 2724 *
6 : jhr 3095 * These are names used in the generated OpenCL code. It includes names from
7 :     * RuntimeNames (c-util/runtime-names.sml), CTypeNames (c-util/c-type-names.sml),
8 :     * and MathNames, plus additional names.
9 : jhr 2403 *)
10 :    
11 : jhr 3095 structure OCLNames =
12 : jhr 2403 struct
13 :    
14 :     local
15 : jhr 2739 structure RN = RuntimeNames
16 : jhr 3095 structure CTyN = CTypeNames
17 :     structure MathN = MathNames
18 :     structure CL = CLang
19 : jhr 2403 in
20 :    
21 : jhr 3095 val globalsTyName = RN.globalsTyName
22 :     val globalsPtrTy = RN.globalsPtrTy
23 :     val inputsPtrTy = RN.inputsPtrTy
24 :     val strandTyName = RN.strandTyName
25 :     val strandPtrTy = RN.strandPtrTy
26 :     val strandInit = RN.strandInit
27 : jhr 2403
28 : jhr 3119 val sizesTyName = "Diderot_Sizes_t"
29 :     val sizesTy = CL.T_Named sizesTyName
30 : jhr 2403
31 : jhr 3095 val gIntTy = CNames.gGPUIntTy (* external API type for Diderot ints *)
32 :     val gRealTy = CNames.gGPURealTy (* external API type for Diderot reals *)
33 : jhr 2403
34 : jhr 3095 (* OpenCL vector types *)
35 : jhr 3116 fun vecTy n = CL.T_Named (concat[!CNames.gRealStem, Int.toString n])
36 : jhr 3095 fun ivecTy n = CL.T_Named (concat[!CNames.gIntStem, Int.toString n])
37 :    
38 :     val matTy = CTyN.matTy
39 :     val ten3Ty = CTyN.ten3Ty
40 :    
41 : jhr 2759 (* strand copy functions *)
42 :     fun copyToGlobal name = name ^ "_CopyToGlobal"
43 :     fun copyFromGlobal name = name ^ "_CopyFromGlobal"
44 :    
45 : jhr 2742 (* standard kernels *)
46 :     val getSizesKern = "GetSizesKern"
47 :     val initGlobalsKern = "InitGlobalsKern"
48 :     val initiallyKern = "InitiallyKern"
49 :     val updateKern = "UpdateKern"
50 : jhr 2758 val outputKern = "OutputKern"
51 :     val snapshotKern = "SnapshotKern"
52 : jhr 2742 val schedKern = "SchedKern"
53 :     val compactKern = "CompactKern"
54 :    
55 : jhr 3125 (* kernels for initializing images *)
56 :     fun imageInitKern name = concat["ImageInit_", name, "Kern"]
57 :    
58 :     (* kernels for reading outputs *)
59 :     fun getOutputKern name = concat["GetOutput_", name, "Kern"]
60 :    
61 : jhr 3095 (* Status_t symbols *)
62 :     val kActive = RN.kActive
63 :     val kNew = RN.kNew
64 :     val kDie = RN.kDie
65 :     val kStabilize = RN.kStabilize
66 :     val kStable = RN.kStable
67 :    
68 :     (* Diderot image operations *)
69 :     val toImageSpace = RN.toImageSpace
70 :     val toWorldSpace = RN.toWorldSpace
71 :     val inside = RN.inside
72 :    
73 :     (* Math function names (some from MathNames) *)
74 : jhr 2403 val max = "max"
75 :     val min = "min"
76 :     val fabs = "fabs"
77 : jhr 3095 val ceil = MathN.ceil
78 :     val floor = MathN.floor
79 :     val round = MathN.round
80 :     val trunc = MathN.trunc
81 : jhr 2403 val clamp = "clamp"
82 : jhr 3095 val lerp = "mix" (* lerp is called mix in OpenCL *)
83 :     val loadVec = MathN.loadVec
84 :     val scale = MathN.scale
85 :     val truncToInt = MathN.truncToInt
86 : jhr 2403 val dot = "dot"
87 :     val cross = "cross"
88 :     val length = "length"
89 :     val normalize = "normalize"
90 : jhr 3118 fun vecitof d = String.concat["convert_", !CNames.gRealStem, Int.toString d]
91 :     fun vecftoi d = String.concat["convert_", !CNames.gIntStem, Int.toString d]
92 : jhr 3095 val zeroMat = MathN.zeroMat
93 :     val identityMat = MathN.identityMat
94 :     val trace = MathN.trace
95 :     val normMat = MathN.normMat
96 :     val copyMat = MathN.copyMat
97 :     val scaleMat = MathN.scaleMat
98 :     val addMat = MathN.addMat
99 :     val subMat = MathN.subMat
100 :     val mulVecMat = MathN.mulVecMat
101 :     val mulMatVec = MathN.mulMatVec
102 :     val mulMatMat = MathN.mulMatMat
103 :     val transposeMat = MathN.transposeMat
104 :     val evecs2x2 = MathN.evecs2x2
105 :     val evecs3x3 = MathN.evecs3x3
106 :     val evals2x2 = MathN.evals2x2
107 :     val evals3x3 = MathN.evals3x3
108 :     val copyTen3 = MathN.copyTen3
109 :     val normTen3 = MathN.normTen3
110 :     val mulVecTen3 = MathN.mulVecTen3
111 :     val mulTen3Vec = MathN.mulTen3Vec
112 :     val colonMul = MathN.colonMul
113 : jhr 2403
114 :     end (* local *)
115 :     end

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